本文整理汇总了C#中Rhino.Geometry.BoundingBox.ToBrep方法的典型用法代码示例。如果您正苦于以下问题:C# BoundingBox.ToBrep方法的具体用法?C# BoundingBox.ToBrep怎么用?C# BoundingBox.ToBrep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino.Geometry.BoundingBox
的用法示例。
在下文中一共展示了BoundingBox.ToBrep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddBrepBox
public static Rhino.Commands.Result AddBrepBox(Rhino.RhinoDoc doc)
{
Rhino.Geometry.Point3d pt0 = new Rhino.Geometry.Point3d(0, 0, 0);
Rhino.Geometry.Point3d pt1 = new Rhino.Geometry.Point3d(10, 10, 10);
Rhino.Geometry.BoundingBox box = new Rhino.Geometry.BoundingBox(pt0, pt1);
Rhino.Geometry.Brep brep = box.ToBrep();
Rhino.Commands.Result rc = Rhino.Commands.Result.Failure;
if( doc.Objects.AddBrep(brep) != System.Guid.Empty )
{
rc = Rhino.Commands.Result.Success;
doc.Views.Redraw();
}
return rc;
}
示例2: RoomVolume
/// <summary>
/// If possible, calculate the volume of the room.
/// </summary>
/// <param name="Breps">Surfaces that make up the model.</param>
/// <param name="Volume"></param>
/// <param name="SurfaceArea"></param>
/// <returns>True if successful.</returns>
public static bool RoomVolume(List<Brep> Breps, ref double Volume, out double[] SurfaceArea)
{
SurfaceArea = new double[Breps.Count];
for (int x = 0; x < Breps.Count; x++)
{
AreaMassProperties ap = AreaMassProperties.Compute(Breps[x]);
SurfaceArea[x] = ap.Area;
}
Brep[] Room = Brep.JoinBreps(Breps, 0.001);
Rhino.RhinoApp.WriteLine("Room is not closed. Using Bounding Volume.");
BoundingBox Box = new BoundingBox();
foreach (Brep srf in Breps)
{
Box.Union(srf.GetBoundingBox(false));
}
///////////////////////////////////////////////////////////////
//Rhino.RhinoDoc.ActiveDoc.Objects.AddPoints(Box.GetCorners());
///////////////////////////////////////////////////////////////
try
{
Volume = VolumeMassProperties.Compute(Box.ToBrep()).Volume;
}
catch
{
Volume = 0;
}
return false;
}