本文整理汇总了C#中IMesh.ToBspTree方法的典型用法代码示例。如果您正苦于以下问题:C# IMesh.ToBspTree方法的具体用法?C# IMesh.ToBspTree怎么用?C# IMesh.ToBspTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMesh
的用法示例。
在下文中一共展示了IMesh.ToBspTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Combine
/// <summary>
/// Combine this mesh with another.
/// </summary>
/// <param name="anotherMesh">Another mesh.</param>
/// <seealso cref="ConstructiveSolidGeometry.Union"/>
public virtual void Combine(IMesh anotherMesh)
{
BspNode<SplittableTriangle> a = this.ToBspTree();
BspNode<SplittableTriangle> b = anotherMesh.ToBspTree();
a.Unite(b);
this.SetBsp(a);
}
示例2: Subtract
/// <summary>
/// Subtracts another mesh from this one.
/// </summary>
/// <param name="anotherMesh">Another mesh.</param>
/// <seealso cref="ConstructiveSolidGeometry.Subtract"/>
public virtual void Subtract(IMesh anotherMesh)
{
BspNode<SplittableTriangle> a = this.ToBspTree();
BspNode<SplittableTriangle> b = anotherMesh.ToBspTree();
a.Invert();
a.Unite(b);
a.Invert();
this.SetBsp(a);
}
示例3: Intersect
/// <summary>
/// Intersects this mesh with another.
/// </summary>
/// <param name="anotherMesh">Another mesh.</param>
/// <seealso cref="ConstructiveSolidGeometry.Intersection"/>
public virtual void Intersect(IMesh anotherMesh)
{
BspNode<SplittableTriangle> a = this.ToBspTree();
BspNode<SplittableTriangle> b = anotherMesh.ToBspTree();
a.Invert(); // Cut geometry that is not common for the meshes.
b.CutTreeOut(a); //
b.Invert(); //
a.CutTreeOut(b); //
// Clean up remains.
b.CutTreeOut(a);
// Combine geometry.
a.AddElements(b.AllElements);
// Invert everything.
a.Invert();
this.SetBsp(a);
}