예제 #1
0
 protected override void BuildMesh(GeoObject o, Del3D meshBuilder, params object[] oparams)
 {
     if (meshBuilder != null)
     {
         o.Mesh = meshBuilder(oparams);
     }
 }
예제 #2
0
파일: Renderer.cs 프로젝트: NMO13/SolidTurn
 protected void SetWireframeViewAndSelection(GeoObject o)
 {
     if (o.WireframeView)
     {
         GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
         GL.Disable(EnableCap.Lighting);
         if (o.IsSelected)
         {
             GL.Enable(EnableCap.ColorMaterial);
             GL.Color3(0.5, 1, 0);
         }
         else
         {
             GL.Disable(EnableCap.ColorMaterial);
             GL.Color3(1.0, 0.0, 0.0);
         }
     }
     else
     {
         GL.Enable(EnableCap.Lighting);
         GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
         if (o.IsSelected)
         {
             GL.Enable(EnableCap.ColorMaterial);
             GL.Color3(0.5, 1, 0);
         }
         else
         {
             GL.Disable(EnableCap.ColorMaterial);
         }
     }
 }
예제 #3
0
파일: Renderer.cs 프로젝트: NMO13/SolidTurn
 public override void SlotChanged(object sender, object e)
 {
     Mesh.CNC_Turning.Machine_Stuff.ToolSet.Slot slot = e as Mesh.CNC_Turning.Machine_Stuff.ToolSet.Slot;
     if (slot != null)
     {
         Tool tool = slot.Tool;
         tool.WireframeView = this.m_WireframeView;
         ActiveTool = tool;
     }
     else
         ActiveTool = null;
 }
예제 #4
0
 protected abstract void BuildMesh(GeoObject o, Del3D meshBuilder, params object[] oparams);
예제 #5
0
        private void Do2DBooleanOps(GeoObject geoObject, BVHPolyMesh2D tsv)
        {
            RoughPartGeoObject o = geoObject as RoughPartGeoObject;
            RoughPartConcentricMesh3D mesh = o.Mesh as RoughPartConcentricMesh3D;
            if (mesh.Poly2D.HECount == 0) // nothing to do
                return;

            BoolDifference subtractor = new BoolDifference(o.VBOManager);

            BVHPolyMesh2D meshA = mesh.Poly2D;
            subtractor.Subtract(mesh.Poly2D.BVH, tsv.BVH);
            mesh.Poly2D = GetMesh(subtractor.MeshesA);
            mesh.Poly2D.BVH = new BVH(mesh.Poly2D);

            #if DEBUG
            foreach (AABRHalfEdge2 h in mesh.Poly2D.HalfEdgeIterator())
            {
                if (h.Origin.X == h.Next.Origin.X && h.Origin.Y == h.Next.Origin.Y)
                    throw new Exception("Vertices are the same");
                if (h.Bucket == null)
                    throw new Exception("Halfedge has no corresponding bucket");
                if(h == h.Twin)
                    throw new Exception("HalfEdge is not correct");
                if (h == h.Next)
                    throw new Exception("HalfEdge is not correct");
            }
            #endif

            o.UpdateMesh();
        }