AB4D Forum
boolean operation error - Printable Version

+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Ab3d.PowerToys (https://forum.ab4d.com/forumdisplay.php?fid=9)
+--- Thread: boolean operation error (/showthread.php?tid=4324)



boolean operation error - kreativasas - 03-17-2022

Hi guys,
i'm trying to do a subtract boolean operation with a geometrymodel and a meshgeometry like that:
Code:
Ab3d.Utilities.MeshBooleanOperations.Subtract(mygeometrymodel3d, mymesh)

but the resulting mesh has positions ok but no normals (the normal collection is empty).
Note that  the starting model and mesh have normals and positions collections ok.

Somebody can help me?


RE: boolean operation error - abenedik - 03-18-2022

You can calculate normals by using Ab3d.Utilities.MeshUtils.CalculateNormals method.

Note that if the mesh does not have MeshGeometry3D.Normals set then they are calcualted internally by WPF (when using WPF 3D rendeirng engine) or internally by DXEngine (when using it to render 3D scene; in this case the normals are not set in the MeshGeometry3D object but in the mesh object that is created by DXEngine). This means that MeshGeometry3D.Normals are not needed for showing the model.