mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
The BIM Tool now provides similar slab-like editing tools for ramps and roofs
This commit is contained in:
@@ -109,7 +109,7 @@ class BimToolUI:
|
|||||||
|
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
||||||
elif cls.props.ifc_class == "IfcSlabType":
|
elif cls.props.ifc_class in ("IfcSlabType", "IfcRampType", "IfcRoofType"):
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
||||||
elif cls.props.ifc_class in ("IfcColumnType", "IfcBeamType", "IfcMemberType"):
|
elif cls.props.ifc_class in ("IfcColumnType", "IfcBeamType", "IfcMemberType"):
|
||||||
@@ -177,7 +177,7 @@ class BimToolUI:
|
|||||||
row.label(text="", icon="EVENT_G")
|
row.label(text="", icon="EVENT_G")
|
||||||
row.operator("bim.hotkey", text="Regen").hotkey = "S_G"
|
row.operator("bim.hotkey", text="Regen").hotkey = "S_G"
|
||||||
row.operator("bim.join_wall", icon="X", text="").join_type = ""
|
row.operator("bim.join_wall", icon="X", text="").join_type = ""
|
||||||
elif AuthoringData.data["active_class"] in ("IfcSlab", "IfcSlabStandardCase"):
|
elif AuthoringData.data["active_class"] in ("IfcSlab", "IfcSlabStandardCase", "IfcRamp", "IfcRoof"):
|
||||||
if context.active_object.mode == "OBJECT":
|
if context.active_object.mode == "OBJECT":
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
row.label(text="", icon="EVENT_SHIFT")
|
row.label(text="", icon="EVENT_SHIFT")
|
||||||
@@ -414,7 +414,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
def hotkey_S_E(self):
|
def hotkey_S_E(self):
|
||||||
if self.active_class in ("IfcWall", "IfcWallStandardCase"):
|
if self.active_class in ("IfcWall", "IfcWallStandardCase"):
|
||||||
bpy.ops.bim.join_wall(join_type="T")
|
bpy.ops.bim.join_wall(join_type="T")
|
||||||
elif self.active_class in ("IfcSlab", "IfcSlabStandardCase"):
|
elif self.active_class in ("IfcSlab", "IfcSlabStandardCase", "IfcRamp", "IfcRoof"):
|
||||||
if not bpy.context.active_object:
|
if not bpy.context.active_object:
|
||||||
pass
|
pass
|
||||||
elif bpy.context.active_object.mode == "OBJECT":
|
elif bpy.context.active_object.mode == "OBJECT":
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ifcopenshell.util.unit
|
import ifcopenshell.util.unit
|
||||||
|
from math import sin, cos
|
||||||
|
|
||||||
|
|
||||||
class Usecase:
|
class Usecase:
|
||||||
@@ -25,6 +26,7 @@ class Usecase:
|
|||||||
self.settings = {
|
self.settings = {
|
||||||
"context": None, # IfcGeometricRepresentationContext
|
"context": None, # IfcGeometricRepresentationContext
|
||||||
"depth": 0.2,
|
"depth": 0.2,
|
||||||
|
"x_angle": 0, # Radians
|
||||||
# Planes are defined as a matrix. The XY plane is the clipping boundary and +Z is removed.
|
# Planes are defined as a matrix. The XY plane is the clipping boundary and +Z is removed.
|
||||||
"clippings": [], # A list of planes that define clipping half space solids
|
"clippings": [], # A list of planes that define clipping half space solids
|
||||||
}
|
}
|
||||||
@@ -47,10 +49,16 @@ class Usecase:
|
|||||||
curve = self.file.createIfcPolyline([self.file.createIfcCartesianPoint(p) for p in points])
|
curve = self.file.createIfcPolyline([self.file.createIfcCartesianPoint(p) for p in points])
|
||||||
else:
|
else:
|
||||||
curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(points))
|
curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(points))
|
||||||
|
if self.settings["x_angle"]:
|
||||||
|
extrusion_direction = self.file.createIfcDirection(
|
||||||
|
(0.0, sin(self.settings["x_angle"]), cos(self.settings["x_angle"]))
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
extrusion_direction = self.file.createIfcDirection((0.0, 0.0, 1.0))
|
||||||
extrusion = self.file.createIfcExtrudedAreaSolid(
|
extrusion = self.file.createIfcExtrudedAreaSolid(
|
||||||
self.file.createIfcArbitraryClosedProfileDef("AREA", None, curve),
|
self.file.createIfcArbitraryClosedProfileDef("AREA", None, curve),
|
||||||
None,
|
None,
|
||||||
self.file.createIfcDirection((0.0, 0.0, 1.0)),
|
extrusion_direction,
|
||||||
self.convert_si_to_unit(self.settings["depth"]),
|
self.convert_si_to_unit(self.settings["depth"]),
|
||||||
)
|
)
|
||||||
if self.settings["clippings"]:
|
if self.settings["clippings"]:
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from math import sin, cos
|
|
||||||
import ifcopenshell.util.unit
|
import ifcopenshell.util.unit
|
||||||
|
from math import sin, cos
|
||||||
|
|
||||||
|
|
||||||
class Usecase:
|
class Usecase:
|
||||||
|
|||||||
Reference in New Issue
Block a user