mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 12:36:55 +00:00
black .
This commit is contained in:
@@ -235,7 +235,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
total_items = len(ObjectMaterialData.data["set_items"])
|
total_items = len(ObjectMaterialData.data["set_items"])
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
layer_set_direction = self.props.material_set_usage_attributes["LayerSetDirection"].enum_value
|
layer_set_direction = self.props.material_set_usage_attributes["LayerSetDirection"].enum_value
|
||||||
if layer_set_direction == 'AXIS3':
|
if layer_set_direction == "AXIS3":
|
||||||
row.label(text="----- Top -----")
|
row.label(text="----- Top -----")
|
||||||
else:
|
else:
|
||||||
row.label(text="----- Exterior -----")
|
row.label(text="----- Exterior -----")
|
||||||
@@ -250,7 +250,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
else:
|
else:
|
||||||
self.draw_read_only_set_item_ui(set_item, index, is_first=index == 0, is_last=index == total_items - 1)
|
self.draw_read_only_set_item_ui(set_item, index, is_first=index == 0, is_last=index == total_items - 1)
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
if layer_set_direction == 'AXIS3':
|
if layer_set_direction == "AXIS3":
|
||||||
row.label(text="----- Bottom -----")
|
row.label(text="----- Bottom -----")
|
||||||
else:
|
else:
|
||||||
row.label(text="----- Interior -----")
|
row.label(text="----- Interior -----")
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ def main(
|
|||||||
if not settings.cells:
|
if not settings.cells:
|
||||||
return svg_data_1.encode("ascii", "xmlcharrefreplace")
|
return svg_data_1.encode("ascii", "xmlcharrefreplace")
|
||||||
|
|
||||||
def yield_groups(n, tag='g'):
|
def yield_groups(n, tag="g"):
|
||||||
if n.nodeType == n.ELEMENT_NODE and n.tagName == tag:
|
if n.nodeType == n.ELEMENT_NODE and n.tagName == tag:
|
||||||
yield n
|
yield n
|
||||||
for c in n.childNodes:
|
for c in n.childNodes:
|
||||||
@@ -433,14 +433,20 @@ def main(
|
|||||||
# wasteful and looses data for unknown reasons
|
# wasteful and looses data for unknown reasons
|
||||||
# svg_contents = svg1.toxml()
|
# svg_contents = svg1.toxml()
|
||||||
# polies = W.svg_to_polygons(svg_contents, "IfcSpace")
|
# polies = W.svg_to_polygons(svg_contents, "IfcSpace")
|
||||||
|
|
||||||
polies = [p.getAttribute('d') for p in yield_groups(svg1, "path") if 'IfcSpace' in p.parentNode.getAttribute('class')]
|
polies = [
|
||||||
assert(all(s.count('M') == 1 for s in polies))
|
p.getAttribute("d")
|
||||||
polies = [[[*map(float, s[1:].split(','))] for s in d.split(' ')[:-1]] for d in polies]
|
for p in yield_groups(svg1, "path")
|
||||||
|
if "IfcSpace" in p.parentNode.getAttribute("class")
|
||||||
|
]
|
||||||
|
assert all(s.count("M") == 1 for s in polies)
|
||||||
|
polies = [[[*map(float, s[1:].split(","))] for s in d.split(" ")[:-1]] for d in polies]
|
||||||
|
|
||||||
def create_poly(b):
|
def create_poly(b):
|
||||||
p = ifcopenshell.ifcopenshell_wrapper.polygon_2()
|
p = ifcopenshell.ifcopenshell_wrapper.polygon_2()
|
||||||
p.boundary = b
|
p.boundary = b
|
||||||
return p
|
return p
|
||||||
|
|
||||||
polies = [create_poly(p) for p in polies]
|
polies = [create_poly(p) for p in polies]
|
||||||
|
|
||||||
def min_bound_extent(p):
|
def min_bound_extent(p):
|
||||||
|
|||||||
Reference in New Issue
Block a user