public BbCutCope( BbElement hostElement, BbProfile profile, double length, double[] zAxis, double[] xAxis, double[] extrudeDirection, double[] position) { //ObjectLocalPlacement = new LocalPlacement3D(hostElement.ObjectLocalPlacement, new Position3D(position)); /// from main piece BbPosition3D pos = BbPosition3D.Create( BbCoordinate3D.Create(position), BbDirection3D.Create(zAxis), BbDirection3D.Create(xAxis)); ObjectBbLocalPlacement = BbLocalPlacement3D.Create( hostElement.ObjectBbLocalPlacement, pos); BbDirection3D exDir; if (Math.Round(extrudeDirection[0], 8) == 0.0 && Math.Round(extrudeDirection[0], 8) == 0 && Math.Round(extrudeDirection[0], 8) == 1) { exDir = BbHeaderSetting.Setting3D.ZAxis; } else { exDir = BbDirection3D.Create(extrudeDirection); } BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create( profile, BbHeaderSetting.Setting3D.DefaultBbPosition3D, exDir, length); _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, }; }
void SetBbDirection3D() { XAxis = RefDirection = BbDirection3D.Create(1, 0, 0); YAxis = BbDirection3D.Create(0, 1, 0); ZAxis = Axis = BbDirection3D.Create(0, 0, 1); XAxisMinus = BbDirection3D.Create(-1, 0, 0); YAxisMinus = BbDirection3D.Create(0, -1, 0); ZAxisMinus = BbDirection3D.Create(0, 0, -1); DefaultOrigin = BbCoordinate3D.Create(); DefaultBbPosition3D = BbPosition3D.Create(DefaultOrigin, Axis, RefDirection); }