private static IfcSurfaceCurveSweptAreaSolid ToIfcSurfaceCurveSweptAreaSolid(this Sweep sweep, Document doc)
        {
            var position  = new Transform().ToIfcAxis2Placement3D(doc);
            var sweptArea = sweep.Profile.Perimeter.ToIfcArbitraryClosedProfileDef(doc);
            var directrix = sweep.Curve.ToIfcCurve(doc);
            var profile   = new IfcArbitraryOpenProfileDef(IfcProfileTypeEnum.CURVE, directrix);

            var extrudeDir          = Vector3.ZAxis.ToIfcDirection();
            var extrudeSurfPosition = new Transform(0, 0, -100).ToIfcAxis2Placement3D(doc);

            doc.AddEntity(extrudeSurfPosition);

            var surface = new IfcSurfaceOfLinearExtrusion(profile, position, extrudeDir, 100);

            // You must use the version of this constructor that has position, startParam,
            // and endParam. If you don't, ArchiCAD (and possibly others) will call
            // the geometry invalid.
            var solid = new IfcSurfaceCurveSweptAreaSolid(sweptArea, position, directrix, 0, 1, surface);

            doc.AddEntity(position);
            doc.AddEntity(sweptArea);
            doc.AddEntity(directrix);

            doc.AddEntity(extrudeDir);
            doc.AddEntity(profile);

            doc.AddEntity(surface);
            doc.AddEntity(solid);

            return(solid);
        }
Beispiel #2
0
 private static ICurve ToCurve(this IfcArbitraryOpenProfileDef profile)
 {
     return(profile.Curve.ToCurve(false));
 }
Beispiel #3
0
 /// <summary>
 /// Convert an IfcArbitraryOpenProfileDef to an ICurve.
 /// </summary>
 /// <param name="profile"></param>
 /// <returns></returns>
 public static ICurve ToICurve(this IfcArbitraryOpenProfileDef profile)
 {
     return(profile.Curve.ToICurve());
 }