public static ShapeBoundBox ExtractBoundingBox(TopoDSShape topoDsShape) { if (topoDsShape == null) { return(null); } var bndBox = ExtractBndBox(topoDsShape); if (bndBox == null) { return(null); } var aXMin = 0d; var aYMin = 0d; var aZMin = 0d; var aXMax = 0d; var aYMax = 0d; var aZMax = 0d; bndBox.Get(ref aXMin, ref aYMin, ref aZMin, ref aXMax, ref aYMax, ref aZMax); var coordinate = new Point3D(aXMin, aYMin, aZMin); var dimensions = new Point3D(aXMax - aXMin, aYMax - aYMin, aZMax - aZMin); var result = new ShapeBoundBox { Coordinate = coordinate, Dimensions = dimensions }; return(result); }
/// <summary> /// Returns False if the boundBox intersects or is inside current /// </summary> public bool IsOut(ShapeBoundBox boundBox) { try { return(BndBox.IsOut(boundBox.BndBox)); } catch { return(true); } }
public ShapeBoundBox Combine(ShapeBoundBox boundBox) { var firstPoint = Coordinate; var lastPoint = boundBox.Coordinate; var minCoordinate = MinCoordinate(firstPoint, lastPoint); firstPoint = firstPoint.AddCoordinate(Dimensions); lastPoint = lastPoint.AddCoordinate(boundBox.Dimensions); var dimensions = ComputeDimensions(firstPoint, lastPoint, minCoordinate); return(new ShapeBoundBox { Coordinate = minCoordinate, Dimensions = dimensions }); }