// System.err.printf("Non-standard angle: %f degrees", angle);
// System.err.println();
// return;
// }
Point3 insertionPoint = new Point3(p[0], p[1], p[2]);
Vector3 extrusionDir = new Vector3(ext[0], ext[1], ext[2]);
// if (extrusionDir.minus(Vector3.K).squaredLength() > MathUtil.EPSILON) { System.err.printf("%f %f %f", extrusionDir.x(), extrusionDir.y(), extrusionDir.z()); System.err.println(); return; }
// if (!MathUtil.areEqual(scale)) {
// System.err.println("Non-uniform scaling");
// }
if (block.root == null) {
int np = block.geometry.getNumPrimitives();
if (np >= ACCEL_THRESHOLD) {
block.root = new BoundingIntervalHierarchy(block.geometry);
} else {
block.root = block.geometry;
}
}
TransformableSceneElement e = new TransformableSceneElement(block.root);
e.translate(block.base.vectorFromOrigin());
e.stretch(scale[0], scale[1], scale[2]);
e.rotateZ(Math.toRadians(angle));
e.translate(insertionPoint.vectorFromOrigin());
Basis3 basis = DxfUtil.getBasisFromArbitraryAxis(extrusionDir);
AffineMatrix3 T = AffineMatrix3.fromColumns(basis.u(), basis.v(), basis.w());
e.transform(T);