CSGOperation.Create

From Solid Graphics Wiki

Jump to: navigation, search

The CSGOperation.Create creates/prepares CSG operation between two Shape class objects. Once CSG operation is created - its result can be retrieved by calling AMinusB, BMinusA, Union, Intersection or GetResult methods.

Syntax

CSGOperation.CSGCreateResult CSGOperation.Create( const Shape & solidA, const Shape & solidB );

Parameters

solidA [in]
Shape
triangle mesh of the shape A of the CSG operation
solidB [in]
Shape
triangle mesh of the shape B of the CSG operation

Return Value

CSGOperation.CSGCreateResult.Success
CSG operation between input shape A and B was successfully calculated.
CSGOperation.CSGCreateResult.Failure
Calculating CSG operation between input shape A and B failed. Additional error information could be retrieved by calling SolidKit.GetLastErrorInfo function. The additional error information is not always available.
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.
CSGOperation.CSGCreateResult.ObjectSurfacesDoNotIntersect
This value is returned when input shapes A and B do not intersect. Calculating CSG operation for this case is not supported by CSGOperation class in this time.

Remarks

The CSGOperation.Create is designed to calculate CSG operation only on shapes representing closed surface mesh - where each mesh edge is part of exactly two triangles oriented in opposite direction of each other along the edge. It is therefore recommended to verify topological validity of the input shapes A and B by calling Shape.IsValidTopology method on each input shape before using these shapes in the CSGOperation.Create method. All mesh/shape triangles must be counterclockwise oriented when looking at the mesh from the outside of mesh volume.

See Also

Personal tools