public static BbCopeProfile Create(double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) { var profile = new BbCopeProfile(copeWidth, copeDepth, copeRadius, copeLocation); BbInstanceDB.AddToExport(profile); return(profile); }
public static BbCutCope Create(BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) { var cutCope = new BbCutCope(hostElement, copeWidth, copeDepth, copeRadius, copeLocation); BbInstanceDB.AddToExport(cutCope); return(cutCope); }
public static BbCutCope Create(BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation, BbPropertySet bbPropertySet, double chamferLength, double chamferDepth, double flangeChamferLength, double flangeChamferWidth, double flangeNotchLength, double flangeNotchWidth, double flangeNotchRadius, double notchLength, double notchDepth, double notchRadius) { var cutCope = new BbCutCope(hostElement, copeWidth, copeDepth, copeRadius, copeLocation); cutCope.AddCutCopeProperty(bbPropertySet, chamferLength, chamferDepth, flangeChamferLength, flangeChamferWidth, flangeNotchLength, flangeNotchWidth, flangeNotchRadius, notchLength, notchDepth, notchRadius); BbInstanceDB.AddToExport(cutCope); return(cutCope); }
BbCutCope( BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) { BbCopeProfile profile = BbCopeProfile.Create(copeWidth, copeDepth, copeRadius, copeLocation); var mainPart = hostElement as BbPiece; if (mainPart == null) { return; } BbPosition3D pos; switch (copeLocation) { case SemCopeLocation.BottomLeft: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, -mainPart.Profile.Depth / 2, 0 }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; case SemCopeLocation.BottomRight: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, -mainPart.Profile.Depth / 2, mainPart.Length }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; case SemCopeLocation.TopRight: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, mainPart.Profile.Depth / 2, mainPart.Length }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; default: // TopLeft pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, mainPart.Profile.Depth / 2, 0 }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; } ObjectBbLocalPlacement = BbLocalPlacement3D.Create( hostElement.ObjectBbLocalPlacement, pos); BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create( profile, BbHeaderSetting.Setting3D.DefaultBbPosition3D, BbHeaderSetting.Setting3D.ZAxis, mainPart.Profile.Width); _ifcOpeningElement = new IfcOpeningElement { GlobalId = IfcGloballyUniqueId.NewGuid(), OwnerHistory = hostElement.IfcObject.OwnerHistory, // Name = // Description = ObjectType = "Opening", ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement, Representation = bbExtrudedGeometry.IfcProductDefinitionShape, }; _ifcRelVoidsElement = new IfcRelVoidsElement { GlobalId = IfcGloballyUniqueId.NewGuid(), OwnerHistory = hostElement.IfcObject.OwnerHistory, Name = "Cope", RelatingBuildingElement = hostElement.IfcObject as IfcElement, RelatedOpeningElement = _ifcOpeningElement, }; }
public BbCopeProfile(double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) : base() { /* * | | width (length) * - |------- * depth - |------| <- radius * | * |-------------- * * */ BbCoordinate2D first; BbCoordinate2D second; BbCoordinate2D third; BbCoordinate2D fourth; BbCoordinate2D fifth; switch (copeLocation) { case SemCopeLocation.BottomLeft: first = BbHeaderSetting.Setting3D.Origin2D; second = BbCoordinate2D.Create(new double[] { 0, copeDepth }); third = BbCoordinate2D.Create(new double[] { copeWidth - copeRadius, copeDepth }); fourth = BbCoordinate2D.Create(new double[] { copeWidth, copeDepth - copeRadius }); fifth = BbCoordinate2D.Create(new double[] { copeWidth, 0 }); break; case SemCopeLocation.BottomRight: first = BbHeaderSetting.Setting3D.Origin2D; second = BbCoordinate2D.Create(new double[] { -copeWidth, 0 }); third = BbCoordinate2D.Create(new double[] { -copeWidth, copeDepth - copeRadius }); fourth = BbCoordinate2D.Create(new double[] { -copeWidth + copeRadius, copeDepth }); fifth = BbCoordinate2D.Create(new double[] { 0, copeDepth }); break; case SemCopeLocation.TopRight: first = BbHeaderSetting.Setting3D.Origin2D; second = BbCoordinate2D.Create(new double[] { 0, -copeDepth }); third = BbCoordinate2D.Create(new double[] { -copeWidth + copeRadius, -copeDepth }); fourth = BbCoordinate2D.Create(new double[] { -copeWidth, -copeDepth + copeRadius }); fifth = BbCoordinate2D.Create(new double[] { -copeWidth, 0 }); break; default: first = BbHeaderSetting.Setting3D.Origin2D; second = BbCoordinate2D.Create(new double[] { copeWidth, 0 }); third = BbCoordinate2D.Create(new double[] { copeWidth, copeRadius - copeDepth }); fourth = BbCoordinate2D.Create(new double[] { copeWidth - copeRadius, -copeDepth }); fifth = BbCoordinate2D.Create(new double[] { 0, -copeDepth }); break; } BbPolyline2D bbPolyline2D = BbPolyline2D.Create(new BbCoordinate2D[] { first, second, third, fourth, fifth, first }); var profile = this.IfcProfileDef as IfcArbitraryClosedProfileDef; profile.OuterCurve = bbPolyline2D.IfcCurve; // }
public static BbCutCope Create(BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation, BbPropertySet bbPropertySet, double chamferLength, double chamferDepth, double flangeChamferLength, double flangeChamferWidth, double flangeNotchLength, double flangeNotchWidth, double flangeNotchRadius, double notchLength, double notchDepth, double notchRadius) { var cutCope = new BbCutCope(hostElement, copeWidth, copeDepth, copeRadius, copeLocation); cutCope.AddCutCopeProperty(bbPropertySet, chamferLength, chamferDepth, flangeChamferLength, flangeChamferWidth, flangeNotchLength, flangeNotchWidth, flangeNotchRadius, notchLength, notchDepth, notchRadius); BbInstanceDB.AddToExport(cutCope); return cutCope; }
public static BbCutCope Create(BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) { var cutCope = new BbCutCope(hostElement, copeWidth, copeDepth, copeRadius, copeLocation); BbInstanceDB.AddToExport(cutCope); return cutCope; }
BbCutCope( BbElement hostElement, double copeWidth, double copeDepth, double copeRadius, SemCopeLocation copeLocation) { BbCopeProfile profile = BbCopeProfile.Create(copeWidth, copeDepth, copeRadius, copeLocation); var mainPart = hostElement as BbPiece; if (mainPart == null) return; BbPosition3D pos; switch (copeLocation) { case SemCopeLocation.BottomLeft: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, -mainPart.Profile.Depth / 2, 0 }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; case SemCopeLocation.BottomRight: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, - mainPart.Profile.Depth / 2, mainPart.Length }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; case SemCopeLocation.TopRight: pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, mainPart.Profile.Depth / 2, mainPart.Length }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; default: // TopLeft pos = BbPosition3D.Create( BbCoordinate3D.Create(new double[] { mainPart.Profile.Width / 2, mainPart.Profile.Depth / 2, 0 }), BbHeaderSetting.Setting3D.XAxisMinus, BbHeaderSetting.Setting3D.ZAxis); break; } ObjectBbLocalPlacement = BbLocalPlacement3D.Create( hostElement.ObjectBbLocalPlacement, pos); BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create( profile, BbHeaderSetting.Setting3D.DefaultBbPosition3D, BbHeaderSetting.Setting3D.ZAxis, mainPart.Profile.Width); _ifcOpeningElement = new IfcOpeningElement { GlobalId = IfcGloballyUniqueId.NewGuid(), OwnerHistory = hostElement.IfcObject.OwnerHistory, // Name = // Description = ObjectType = "Opening", ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement, Representation = bbExtrudedGeometry.IfcProductDefinitionShape, }; _ifcRelVoidsElement = new IfcRelVoidsElement { GlobalId = IfcGloballyUniqueId.NewGuid(), OwnerHistory = hostElement.IfcObject.OwnerHistory, Name = "Cope", RelatingBuildingElement = hostElement.IfcObject as IfcElement, RelatedOpeningElement = _ifcOpeningElement, }; }