CSGOperation.BMinusA

From Solid Graphics Wiki

(Difference between revisions)
Jump to: navigation, search

Rgrof (Talk | contribs)
(New page: The '''CSGOperation.BMinusA''' method retrieves B minus A result of CSG operation between two Shape class objects. The CSG operation must be created by calling the [[CSGOperation.C...)
Next diff →

Current revision

The CSGOperation.BMinusA method retrieves B minus A result of CSG operation between two Shape class objects. The CSG operation must be created by calling the CSGOperation.Create method before the BMinusA method is called.

Syntax

bool CSGOperation.BMinusA( Shape solid );
bool CSGOperation.BMinusA( Shape solid, TriangleOriginInfo triangleOriginInfo );

Parameters

solid [out]
Shape
triangle mesh of the B minus A result of the CSG operation
triangleOriginInfo [out]
TriangleOriginInfo
array of identifiers which can be used to determine origins of result triangles returned in the shape parameter. A TriangleOriginInfo structure is returned for each triangle in the result and for each result triangle it can be used to determine whether the triangle came from CSG operation input shape A or B, and from which triangle of that shape.

Return Value

Method returns true in case of success and false in case of failure. In case of failure the result is undefined, even though in lot of cases the result visually seems correct. In most cases the reason for failure is that the SolidKit Library software is not able to adapt to imprecisions in floating point calculations on computer hardware (CPU). This is a limitation of the SolidKit library - see Support of Constructive Solid Geometry in the SolidKit Library for more information.

In cases where false is returned when retrieving CSG operation result, and such result will be used as input in subsequent CSG operation - then calculation of such subsequent CSG operation will most likely fail.

Remarks

The CSG operation must be created by calling the CSGOperation.Create method before retrieving the operation result using the BMinusA method.

The version of the method which does not return TriangleOriginInfo information also tries to reduce number of triangles in returned result shape by internally calling Shape.ReduceCoplanarTriangles method on the result shape before exiting the method.

See Also

Personal tools