virtual public void UpdateGeometry() { if (curve_timestamp != curve.Timestamp) { if (EnableLineRenderer) { LineRenderer ren = root.GetComponent <LineRenderer>(); int Nc = curve.VertexCount; int N = (curve.Closed) ? Nc + 1 : Nc; Vector3[] vec = new Vector3[N]; for (int i = 0; i < N; ++i) { vec[i] = (Vector3)curve[i % Nc]; } ren.numPositions = N; ren.SetPositions(vec); } localBounds = curve.GetBoundingBox(); UpdateGeometry_internal(); curve_timestamp = curve.Timestamp; increment_timestamp(); on_curve_modified(); } }
public ImplicitCurve3d(DCurve3 curve, double radius) { Curve = curve; Radius = radius; Box = curve.GetBoundingBox(); Box.Expand(Radius); spatial = new DCurve3BoxTree(curve); }
public virtual SceneObject BuildSO(Func <DCurve3, SceneObject> SOBuilderF, SOMaterial material, float scale = 1.0f) { // create shifted curve Vector3d vCenter = curve.GetBoundingBox().Center; DCurve3 shifted = bake_transform(-vCenter); Frame3f shiftedFrame = new Frame3f((Vector3f)vCenter, Quaternionf.Identity); SceneObject so = SOBuilderF(shifted); so.SetLocalFrame(shiftedFrame, CoordSpace.WorldCoords); return(so); }
public virtual TransformableSO BuildSO(Func <DCurve3, TransformableSO> SOBuilderF, SOMaterial material, float scale = 1.0f) { Vector3d vCenter = curve.GetBoundingBox().Center; DCurve3 shifted = new DCurve3(curve); for (int i = 0; i < shifted.VertexCount; ++i) { shifted[i] -= vCenter; } Frame3f shiftedFrame = new Frame3f((Vector3f)vCenter, Quaternionf.Identity); TransformableSO so = SOBuilderF(shifted); so.SetLocalFrame(shiftedFrame, CoordSpace.WorldCoords); return(so); }
public PolyTubeSO BuildSO(SOMaterial material, float scale = 1.0f) { Vector3d vCenter = curve.GetBoundingBox().Center; DCurve3 shifted = new DCurve3(curve); for (int i = 0; i < shifted.VertexCount; ++i) { shifted[i] -= vCenter; } Frame3f shiftedFrame = new Frame3f((Vector3f)vCenter, Quaternionf.Identity); PolyTubeSO so = new PolyTubeSO() { Curve = shifted, Polygon = polygon }; so.Create(material); so.SetLocalFrame(shiftedFrame, CoordSpace.WorldCoords); return(so); }
public override BoundingBox GetBoundingBox(Transform xform) { return(crv.GetBoundingBox().ToRhino()); }