Posts: 553
Threads: 8
%%TYL_NUMTHANKEDLIKED%%
Joined: Sep 2009
Reputation:
4
3D lines are generated in such a way that for each line a rectangle (2 triangles) is generated so that the rectangle is facing the camera and that it has the specified line thickness on the screen. This means that on each camera change or change or the line positions, the line's MeshGeometry3D needs to be regenerated. Therefore you cannot do Boolean operations on the lines.
But instead of using LineVisual3D object (or any other Visual3D that is derived from BaseLineVisual3D) you can use TubeLineVisual3D - this object creates a tube MeshGeometry3D for each line. This MeshGeometry3D is fixed and therefore you can use Boolean operations on it. Also note, then for TubeLineVisual3D you do not specify the line thickness in screen coordinates but you specify the tube's Radius that is in world coordinates.
Anyway, I am curious why you need to use Boolean operations on 3D lines. Maybe you could split the line into multiple lines instead - using MultiLineVisual3D or multiple LineVisual3D objects to show parts of the line.
Andrej Benedik
Posts: 553
Threads: 8
%%TYL_NUMTHANKEDLIKED%%
Joined: Sep 2009
Reputation:
4
Thanks for the information.
So you probably also do Boolean operations on the solid model3D object. In this case you could also regenerate the lines for the wireframe.
One more tip: if have a lot of LineVisual3D objects and you want to improve the performance of your application, then you can use MultiLineVisual3D instead of multiple LineVisual3D objects. You are less flexible with a MultiLineVisual3D and also need to use a single color for all lines in MultiLineVisual3D, but the performance will be better.
Rendering many 3D lines with Ab3d.PowerToys and WPF 3D rendering can be slow because the geometry for all the lines need to be generated on the CPU. Consider using Ab3d.DXEngine as it can render millions of 3D lines because full hardware acceleration is used there. With Ab3d.DXEngine you can also set different colors for line positions - so you can render multiple lines with different colors with one object (draw call).
Andrej Benedik