Ejemplo n.º 1
0
        /// <summary>
        /// adds an expand/contract-type plane/leg intersection thing at the given frame
        /// </summary>
        public static void EmitPlaneBandExpansionFromTool(SceneObject targetLegSO, Frame3f planeFrameS)
        {
            PlaneIntersectionCurveSO curveSO = PlaneIntersectionCurveSO.CreateFromPlane(
                targetLegSO as DMeshSO, planeFrameS, OrthogenMaterials.PlaneCurveMaterial,
                targetLegSO.GetScene(), OrthogenUI.CurveOnSurfaceOffsetTol);

            AddNewPlaneBandExpansion(curveSO);

            // [RMS] this is called at end
            OG.Context.RegisterNextFrameAction(() => {
                OG.Scene.Select(curveSO, true);
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// adds an expand/contract-type plane/leg intersection thing at the given frame
        /// </summary>
        public static void EmitOffsetBandFromTool(SceneObject targetLegSO, Frame3f startFrameS, Frame3f endFrameS)
        {
            Frame3f midFrame = new Frame3f((startFrameS.Origin + endFrameS.Origin) * 0.5f);
            PlaneIntersectionCurveSO curveSO = PlaneIntersectionCurveSO.CreateFromPlane(
                targetLegSO as DMeshSO, midFrame, OrthogenMaterials.PlaneCurveMaterial,
                targetLegSO.GetScene(), OrthogenUI.CurveOnSurfaceOffsetTol);

            curveSO.Name = "PlaneBandExpansion";
            curveSO.RootGameObject.SetLayer(OrthogenMaterials.CurvesLayer);

            // create and associate deformation op
            PlaneBandExpansionOp deformOp = OG.Leg.AppendPlaneBandExpansion(curveSO) as PlaneBandExpansionOp;

            deformOp.BandDistance = startFrameS.Origin.Distance(endFrameS.Origin) * 0.5;


            OG.Model.RegisterDeleteSOAction(curveSO, MakeDeleteLegDeformationAction(deformOp));
            OG.Model.RegisterSelectSOAction(curveSO, MakeSelectLegDeformationAction(deformOp));

            // [RMS] this is called at end
            OG.Context.RegisterNextFrameAction(() => {
                OG.Scene.Select(curveSO, true);
            });
        }