How to display MeshElement3D as a wireframe?

I would like to display any MeshElement3D (e.g. BoxVisual3d) in helix-toolkit as a wireframe. How can I do that?

EDIT:

Thanks to the answer of Erno de Weerd, I was able to write the following code

  • BoxVisual3D Extending Class

    public class GeometryBoxVisual3D : BoxVisual3D { public MeshGeometry3D Geometry() { return Tessellate(); } } 
  • Add a window instance to the Viewport:

      GeometryBoxVisual3D box = new GeometryBoxVisual3D(); box.Fill = new SolidColorBrush(Colors.Red); Viewport3D.Children.Add(box); MeshGeometry3D geometry3 = box.Geometry(); LinesVisual3D lines = new LinesVisual3D(); lines.Thickness = 3; lines.Points = geometry3.Positions; lines.Transform = new TranslateTransform3D(3,1,1); Viewport3D.Children.Add(lines); 

As a result, the following message will be displayed:

enter image description here

If I hide the original box and put LinesVisual3D on top of the window, I can display the wired mode as if it were the original object, but it still has no edges on the side.

+5
source share
1 answer

By calling MeshElement3D.Tesselate() , you can get MeshGeometry3D (mesh).

Next, create a LinesVisual3D object.

Copy the mesh points to the LinesVisual3D points.

This will create an internal grid (see sources: LinesVisual3D.cs in helix set )

Finally, make sure you set the thickness of LinesVisual3D and add it to the scene.

+5
source

Source: https://habr.com/ru/post/1213662/


All Articles