1 package eu.mihosoft.vrl.v3d;
3 import java.util.ArrayList;
30 public static CSG corner(
double rad,
double angle) {
43 ArrayList<CSG> parts =
new ArrayList<>();
45 int size = p.vertices.size();
46 for (
int i = 0; i < size; i++) {
52 int nextNext = next + 1;
55 Vector3d position0 = p.vertices.get(i).pos;
56 Vector3d position1 = p.vertices.get(next).pos;
57 Vector3d position2 = p.vertices.get(nextNext).pos;
61 double angle = Math.toDegrees(seg1.
angle(seg2));
63 CSG fillet =
new Fillet(rad, len).toCSG().toYMax();
66 angleAbs = 360 - angleAbs;
69 if (Math.abs(angle) > 0.01 && Math.abs(angle) < 180) {
70 parts.add(
corner(rad, angle).rotz(angleAbs).move(position0));
73 parts.add(fillet.
rotz(angleAbs).
move(position0));
List< Polygon > getPolygons()
CSG rotz(Number degreesToRotate)
static CSG unionAll(CSG... csgs)
CSG move(Number x, Number y, Number z)
CSG difference(List< CSG > csgs)
CSG movey(Number howFarToMove)
CSG rotx(Number degreesToRotate)
static ArrayList< CSG > revolve(CSG slice, double radius, int numSlices)
static CSG outerFillet(List< Polygon > polys, double rad)
List< Polygon > toPolygons()
final PropertyStorage properties
PropertyStorage getProperties()
static CSG outerFillet(CSG base, double rad)
Fillet(double w, double h)
static CSG corner(double rad, double angle)
static List< Polygon > slice(CSG incoming, Transform slicePlane, double normalInsetDistance)
Vector3d minus(Vector3d v)
static Vector3d x(double x)
static final Vector3d Y_ONE