示例#1
0
        public IVectorDisplacementSourceOp AppendRegionSmoothOp(EnclosedPatchSO Source)
        {
            PolyCurveSOSourceOp    curveOp  = new PolyCurveSOSourceOp(Source);
            EnclosedRegionSmoothOp deformOp = new EnclosedRegionSmoothOp()
            {
                SmoothAlpha = 0.5f,
                MeshSource  = SOMeshSource,
                CurveSource = curveOp
            };

            Combiner.Append(deformOp);
            SO_Op.Add(Source, deformOp);

            OnDeformationAdded?.Invoke(Source, deformOp);

            return(deformOp);
        }
示例#2
0
        public IVectorDisplacementSourceOp AppendRegionOffset(EnclosedPatchSO Source)
        {
            Frame3f deformF = Frame3f.Identity;

            deformF = SceneTransforms.TransformTo(deformF, Source, leg);

            PolyCurveSOSourceOp    curveOp  = new PolyCurveSOSourceOp(Source);
            EnclosedRegionOffsetOp deformOp = new EnclosedRegionOffsetOp()
            {
                Normal           = deformF.Y,
                PushPullDistance = 2.0f,
                MeshSource       = SOMeshSource,
                CurveSource      = curveOp
            };

            Combiner.Append(deformOp);
            SO_Op.Add(Source, deformOp);

            OnDeformationAdded?.Invoke(Source, deformOp);

            return(deformOp);
        }
        public SocketModel(SocketSO Socket, LegModel leg, TrimLoopSO trimLineIn, ModelModes eMode) : base(Socket.Mesh, false)
        {
            socket = Socket;

            this.leg = leg;
            leg.SO.OnTransformModified += leg_transform_modified;

            this.trimLine = trimLineIn;

            LegSourceOp      = new ShapeModelOutputMeshSourceOp(leg);
            TrimlineSourceOp = new PolyCurveSOSourceOp(this.trimLine);

            if (eMode == ModelModes.Socket)
            {
                DeviceGenOp = new SocketGeneratorOp();
            }
            else
            {
                DeviceGenOp = new AFOGeneratorOp();
            }

            DeviceGenOp.MeshSource               = LegSourceOp;
            DeviceGenOp.CurveSource              = TrimlineSourceOp;
            DeviceGenOp.SocketVertexColor        = Colorf.CornflowerBlue;
            DeviceGenOp.PartialSocketVertexColor = ColorMixer.Darken(Colorf.SelectionGold, 0.75f);
            DeviceGenOp.SocketThickness          = this.SocketThickness;
            DeviceGenOp.InnerWallOffset          = this.SocketOffset;
            DeviceGenOp.ConnectorCutHeight       = this.ConnectorCutHeight;

            Compute = new ThreadedMeshComputeOp()
            {
                MeshSource = DeviceGenOp
            };

            // initialize socket input transform
            leg_transform_modified(leg.SO);
        }