mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Purge old swept solid system. No longer relevant in the land of native IFC.
This commit is contained in:
@@ -61,14 +61,6 @@ if bpy is not None:
|
||||
operator.ExportIFC,
|
||||
operator.ImportIFC,
|
||||
operator.SelectExternalMaterialDir,
|
||||
operator.AddSweptSolid,
|
||||
operator.RemoveSweptSolid,
|
||||
operator.AssignSweptSolidOuterCurve,
|
||||
operator.SelectSweptSolidOuterCurve,
|
||||
operator.AddSweptSolidInnerCurve,
|
||||
operator.SelectSweptSolidInnerCurves,
|
||||
operator.AssignSweptSolidExtrusion,
|
||||
operator.SelectSweptSolidExtrusion,
|
||||
operator.FetchExternalMaterial,
|
||||
operator.FetchObjectPassport,
|
||||
operator.CutSection,
|
||||
@@ -123,7 +115,6 @@ if bpy is not None:
|
||||
prop.GlobalId,
|
||||
prop.BIMObjectProperties,
|
||||
prop.BIMMaterialProperties,
|
||||
prop.SweptSolid,
|
||||
prop.ItemSlotMap,
|
||||
prop.BIMMeshProperties,
|
||||
ui.BIM_PT_section_plane,
|
||||
|
||||
@@ -177,136 +177,6 @@ class OpenUri(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddSweptSolid(bpy.types.Operator):
|
||||
bl_idname = "bim.add_swept_solid"
|
||||
bl_label = "Add Swept Solid"
|
||||
|
||||
def execute(self, context):
|
||||
swept_solids = bpy.context.active_object.data.BIMMeshProperties.swept_solids
|
||||
swept_solid = swept_solids.add()
|
||||
swept_solid.name = "Swept Solid {}".format(len(swept_solids))
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class RemoveSweptSolid(bpy.types.Operator):
|
||||
bl_idname = "bim.remove_swept_solid"
|
||||
bl_label = "Remove Swept Solid"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
bpy.context.active_object.data.BIMMeshProperties.swept_solids.remove(self.index)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AssignSweptSolidOuterCurve(bpy.types.Operator):
|
||||
bl_idname = "bim.assign_swept_solid_outer_curve"
|
||||
bl_label = "Assign Outer Curve"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
vertices = [v.index for v in bpy.context.active_object.data.vertices if v.select == True]
|
||||
bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index].outer_curve = json.dumps(vertices)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SelectSweptSolidOuterCurve(bpy.types.Operator):
|
||||
bl_idname = "bim.select_swept_solid_outer_curve"
|
||||
bl_label = "Select Outer Curve"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
outer_curve = bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index].outer_curve
|
||||
if not outer_curve:
|
||||
return {"FINISHED"}
|
||||
indices = json.loads(outer_curve)
|
||||
for index in indices:
|
||||
bpy.context.active_object.data.vertices[index].select = True
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AddSweptSolidInnerCurve(bpy.types.Operator):
|
||||
bl_idname = "bim.add_swept_solid_inner_curve"
|
||||
bl_label = "Add Inner Curve"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
vertices = [v.index for v in bpy.context.active_object.data.vertices if v.select == True]
|
||||
swept_solid = bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index]
|
||||
if swept_solid.inner_curves:
|
||||
curves = json.loads(swept_solid.inner_curves)
|
||||
else:
|
||||
curves = []
|
||||
curves.append(vertices)
|
||||
swept_solid.inner_curves = json.dumps(curves)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SelectSweptSolidInnerCurves(bpy.types.Operator):
|
||||
bl_idname = "bim.select_swept_solid_inner_curves"
|
||||
bl_label = "Select Inner Curves"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
inner_curves = bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index].inner_curves
|
||||
if not inner_curves:
|
||||
return {"FINISHED"}
|
||||
curves = json.loads(inner_curves)
|
||||
for curve in curves:
|
||||
for index in curve:
|
||||
bpy.context.active_object.data.vertices[index].select = True
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class AssignSweptSolidExtrusion(bpy.types.Operator):
|
||||
bl_idname = "bim.assign_swept_solid_extrusion"
|
||||
bl_label = "Assign Extrusion"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
vertices = [v.index for v in bpy.context.active_object.data.vertices if v.select == True]
|
||||
bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index].extrusion = json.dumps(vertices)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SelectSweptSolidExtrusion(bpy.types.Operator):
|
||||
bl_idname = "bim.select_swept_solid_extrusion"
|
||||
bl_label = "Select Extrusion"
|
||||
index: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
if bpy.context.mode != "EDIT_MESH":
|
||||
return {"FINISHED"}
|
||||
bpy.ops.object.mode_set(mode="OBJECT")
|
||||
extrusion = bpy.context.active_object.data.BIMMeshProperties.swept_solids[self.index].extrusion
|
||||
if not extrusion:
|
||||
return {"FINISHED"}
|
||||
indices = json.loads(extrusion)
|
||||
for index in indices:
|
||||
bpy.context.active_object.data.vertices[index].select = True
|
||||
bpy.ops.object.mode_set(mode="EDIT")
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class SelectExternalMaterialDir(bpy.types.Operator):
|
||||
bl_idname = "bim.select_external_material_dir"
|
||||
bl_label = "Select Material File"
|
||||
|
||||
@@ -259,13 +259,6 @@ class BIMMaterialProperties(PropertyGroup):
|
||||
ifc_style_id: IntProperty(name="IFC Style ID")
|
||||
|
||||
|
||||
class SweptSolid(PropertyGroup):
|
||||
name: StringProperty(name="Name")
|
||||
outer_curve: StringProperty(name="Outer Curve")
|
||||
inner_curves: StringProperty(name="Inner Curves")
|
||||
extrusion: StringProperty(name="Extrusion")
|
||||
|
||||
|
||||
class ItemSlotMap(PropertyGroup):
|
||||
name: StringProperty(name="Item Element ID")
|
||||
slot_index: IntProperty(name="Material Slot Index")
|
||||
@@ -275,7 +268,6 @@ class BIMMeshProperties(PropertyGroup):
|
||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||
is_native: BoolProperty(name="Is Native", default=False)
|
||||
is_swept_solid: BoolProperty(name="Is Swept Solid")
|
||||
swept_solids: CollectionProperty(name="Swept Solids", type=SweptSolid)
|
||||
is_parametric: BoolProperty(name="Is Parametric", default=False)
|
||||
ifc_definition: StringProperty(name="IFC Definition")
|
||||
ifc_parameters: CollectionProperty(name="IFC Parameters", type=IfcParameter)
|
||||
|
||||
Reference in New Issue
Block a user