コード例 #1
0
        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();
            }
        }
コード例 #2
0
 public ImplicitCurve3d(DCurve3 curve, double radius)
 {
     Curve  = curve;
     Radius = radius;
     Box    = curve.GetBoundingBox();
     Box.Expand(Radius);
     spatial = new DCurve3BoxTree(curve);
 }
コード例 #3
0
ファイル: CurvePreview.cs プロジェクト: xiaodelea/frame3Sharp
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: MeshTubePreview.cs プロジェクト: tomleetv/gsCore
        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);
        }
コード例 #6
0
ファイル: EdgeConstraint_Goo.cs プロジェクト: joelhi/g3-gh
 public override BoundingBox GetBoundingBox(Transform xform)
 {
     return(crv.GetBoundingBox().ToRhino());
 }