private List <Data.Vertex3DItemCollection> GetVertexList(int index) { List <Data.OsnapVertex3D> osnap = vizcore3d.Object3D.GetOsnapPoint(index); List <Data.Vertex3DItemCollection> vertex = new List <Data.Vertex3DItemCollection>(); foreach (Data.OsnapVertex3D point in osnap) { if (point.Kind == Data.OsnapKind.LINE) { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(point.Start); item.Add(point.End); vertex.Add(item); } else if (point.Kind == Data.OsnapKind.CIRCLE) { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(point.Start); item.Add(point.End); vertex.Add(item); } } return(vertex); }
private List <Data.Vertex3DItemCollection> GetVertexList() { List <Data.Vertex3DItemCollection> vertex = new List <Data.Vertex3DItemCollection>(); Data.BoundBox3D boundbox = vizcore3d.Object3D.GeometryProperty.FromSelectedObject3D(false).GetBoundBox(); { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MinY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MaxY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MaxY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MinY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MinY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MinY, boundbox.MaxZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MaxY, boundbox.MaxZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MaxY, boundbox.MaxZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MinY, boundbox.MaxZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MinY, boundbox.MaxZ)); vertex.Add(item); } { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MaxY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MinX, boundbox.MaxY, boundbox.MaxZ)); vertex.Add(item); } { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MaxY, boundbox.MinZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MaxY, boundbox.MaxZ)); vertex.Add(item); } { Data.Vertex3DItemCollection item = new Data.Vertex3DItemCollection(); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MinY, boundbox.MaxZ)); item.Add(new Data.Vertex3D(boundbox.MaxX, boundbox.MinY, boundbox.MinZ)); vertex.Add(item); } return(vertex); }
private void backgroundWorkerTurnOver_ProgressChanged(object sender, ProgressChangedEventArgs e) { int step = e.ProgressPercentage; if (backgroundWorkerTurnOver.CancellationPending == true) return; vizcore3d.BeginUpdate(); vizcore3d.Object3D.Transform.Rotate(BLOCK_NODES, -1, 0, 0, false, false); // LUG1 - ROLLER1 // LUG2 - ROLLER4 vizcore3d.ShapeDrawing.Clear(); vizcore3d.ShapeDrawing.DepthTest = true; bool find = false; if (DisplayAngle == true) vizcore3d.Review.Measure.Clear(); for (int i = 0; i < 7; i++) { VIZCore3D.NET.Data.Node lug1 = LUG1[i + 1]; VIZCore3D.NET.Data.Object3DProperty propLug1 = vizcore3d.Object3D.GeometryProperty.FromNode(lug1); VIZCore3D.NET.Data.Node roller1 = ROLLER1[i + 1]; VIZCore3D.NET.Data.Object3DProperty propRoller1 = vizcore3d.Object3D.GeometryProperty.FromNode(roller1); VIZCore3D.NET.Data.Node lug2 = LUG2[i + 1]; VIZCore3D.NET.Data.Object3DProperty propLug2 = vizcore3d.Object3D.GeometryProperty.FromNode(lug2); VIZCore3D.NET.Data.Node roller2 = ROLLER4[i + 1]; VIZCore3D.NET.Data.Object3DProperty propRoller2 = vizcore3d.Object3D.GeometryProperty.FromNode(roller2); { List<VIZCore3D.NET.Data.Vertex3DItemCollection> item1 = new List<Data.Vertex3DItemCollection>(); VIZCore3D.NET.Data.Vertex3DItemCollection coll1 = new Data.Vertex3DItemCollection(); coll1.Add(propLug1.CenterPoint); coll1.Add(propRoller1.CenterPoint); item1.Add(coll1); vizcore3d.ShapeDrawing.AddLine(item1, i, Color.Black, 1, true); //vizcore3d.ShapeDrawing.AddCylinder(item1, i, Color.Black, 10, true); } { List<VIZCore3D.NET.Data.Vertex3DItemCollection> item2 = new List<Data.Vertex3DItemCollection>(); VIZCore3D.NET.Data.Vertex3DItemCollection coll2 = new Data.Vertex3DItemCollection(); coll2.Add(propLug2.CenterPoint); coll2.Add(propRoller2.CenterPoint); item2.Add(coll2); vizcore3d.ShapeDrawing.AddLine(item2, i + 7, Color.Black, 1, true); //vizcore3d.ShapeDrawing.AddCylinder(item2, i + 7, Color.Black, 10, true); } CollisionItem collision1 = new CollisionItem(); CollisionItem collision2 = new CollisionItem(); bool find1 = AddCollisionData(step, lug1.NodeName, roller1.NodeName, propLug1.CenterPoint, propRoller1.CenterPoint, "TOB #1", out collision1); bool find2 = AddCollisionData(step, lug2.NodeName, roller2.NodeName, propLug2.CenterPoint, propRoller2.CenterPoint, "TOB #2", out collision2); if (find1 == true || find2 == true) find = true; AddAngle(lug1, propLug1.CenterPoint, propRoller1.CenterPoint, find1 == true ? collision1 : null); AddAngle(lug2, propLug2.CenterPoint, propRoller2.CenterPoint, find2 == true ? collision2 : null); } vizcore3d.EndUpdate(); if (find == true && StopTurnOver == true) backgroundWorkerTurnOver.CancelAsync(); Application.DoEvents(); }