public static DB.GeometryObject[] ToShape(this GeometryBase geometry, double factor) { switch (geometry) { case Point point: return(new DB.Point[] { point.ToPoint(factor) }); case PointCloud pointCloud: return(pointCloud.ToPoints(factor)); case Curve curve: return(curve.ToCurveMany(factor).SelectMany(x => x.ToBoundedCurves()).ToArray()); case Brep brep: return(new DB.GeometryObject[] { ToShape(brep, factor) }); case Extrusion extrusion: return(new DB.GeometryObject[] { ToShape(extrusion, factor) }); case SubD subD: return(new DB.GeometryObject[] { ToShape(subD, factor) }); case Mesh mesh: return(new DB.GeometryObject[] { MeshEncoder.ToMesh(MeshEncoder.ToRawMesh(mesh, factor)) }); default: if (geometry.HasBrepForm) { var brepForm = Brep.TryConvertBrep(geometry); return(new DB.GeometryObject[] { ToShape(brepForm, factor) }); } return(new DB.GeometryObject[0]); } }
public static DB.Mesh ToMesh(this Mesh value, double factor) => MeshEncoder.ToMesh(MeshEncoder.ToRawMesh(value, factor));
public static DB.Mesh ToMesh(this Mesh value) => MeshEncoder.ToMesh(MeshEncoder.ToRawMesh(value, UnitConverter.ToHostUnits));