mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
#1153 Breaklines are now pure lines separate from fill areas and orient correctly
This commit is contained in:
@@ -23,9 +23,8 @@ text { fill: black; stroke: none; }
|
|||||||
.cut { fill: black; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; fill-rule: evenodd; }
|
.cut { fill: black; stroke: black; stroke-linecap: 'round'; stroke-width: 0.35; fill-rule: evenodd; }
|
||||||
.projection { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
.projection { fill: white; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
.annotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
.solid {}
|
|
||||||
.IfcAnnotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
.IfcAnnotation { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; }
|
||||||
.PredefinedType-MISC { stroke: black; stroke-width: 0.25; }
|
.PredefinedType-LINEWORK { stroke: black; stroke-width: 0.25; }
|
||||||
.PredefinedType-BACKGROUND { stroke: black; stroke-width: 0.18; }
|
.PredefinedType-BACKGROUND { stroke: black; stroke-width: 0.18; }
|
||||||
.PredefinedType-GRID { marker-start: url(#grid-marker); marker-end: url(#grid-marker); }
|
.PredefinedType-GRID { marker-start: url(#grid-marker); marker-end: url(#grid-marker); }
|
||||||
.PredefinedType-SECTION { stroke-dasharray: 12.5, 3, 3, 3; }
|
.PredefinedType-SECTION { stroke-dasharray: 12.5, 3, 3, 3; }
|
||||||
@@ -37,11 +36,11 @@ text { fill: black; stroke: none; }
|
|||||||
.PredefinedType-BOUNDARY { fill: none; stroke: red; stroke-width: 1; stroke-dasharray: 12, 4, 3, 4, 3, 4; }
|
.PredefinedType-BOUNDARY { fill: none; stroke: red; stroke-width: 1; stroke-dasharray: 12, 4, 3, 4, 3, 4; }
|
||||||
.PredefinedType-BATTING { marker-start: url(#batting); stroke: none; }
|
.PredefinedType-BATTING { marker-start: url(#batting); stroke: none; }
|
||||||
.PredefinedType-SEALANT { fill: url(#crosshatch1); stroke-width: 0.25; }
|
.PredefinedType-SEALANT { fill: url(#crosshatch1); stroke-width: 0.25; }
|
||||||
|
.PredefinedType-FILLAREA { fill: white; stroke: none; }
|
||||||
|
.PredefinedType-BREAKLINE { fill: none; stroke: black; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
|
||||||
.PredefinedType-TEXT { fill: black; stroke: none; }
|
.PredefinedType-TEXT { fill: black; stroke: none; }
|
||||||
path.PredefinedType-TEXTLEADER { marker-end: url(#leader-marker); }
|
path.PredefinedType-TEXTLEADER { marker-end: url(#leader-marker); }
|
||||||
text.PredefinedType-TEXTLEADER { fill: black; stroke: none; }
|
text.PredefinedType-TEXTLEADER { fill: black; stroke: none; }
|
||||||
.break { fill: white; }
|
|
||||||
.breakline { fill: none; stroke: black; stroke-linecap: 'round'; stroke-width: 0.25; marker-mid: url(#breakline-marker); }
|
|
||||||
.material-blank { fill: white; }
|
.material-blank { fill: white; }
|
||||||
.material-diagonal1 { fill: url(#diagonal1); }
|
.material-diagonal1 { fill: url(#diagonal1); }
|
||||||
.material-diagonal2 { fill: url(#diagonal2); }
|
.material-diagonal2 { fill: url(#diagonal2); }
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
<path d="M 0 1 L 90 1" class="annotation" style="stroke-width:1;" />
|
<path d="M 0 1 L 90 1" class="annotation" style="stroke-width:1;" />
|
||||||
</g>
|
</g>
|
||||||
</marker>
|
</marker>
|
||||||
<marker id="breakline-marker" markerHeight="20" markerWidth="15" refX="7.5" refY="10">
|
<marker id="breakline-marker" markerHeight="20" markerWidth="15" refX="7.5" refY="10" orient="auto">
|
||||||
<g>
|
<g>
|
||||||
<path d="M 0 10 L 5 20 L 7.5 10" class="annotation" style="stroke-width:1; fill: white;" />
|
<path d="M 0 10 L 5 20 L 7.5 10" class="annotation" style="stroke-width:1; fill: white;" />
|
||||||
<path d="M 7.5 10 L 10 0 L 15 10" class="annotation" style="stroke-width:1; fill: white;" />
|
<path d="M 7.5 10 L 10 0 L 15 10" class="annotation" style="stroke-width:1; fill: white;" />
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -557,14 +557,16 @@ class SvgWriter:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw_break_annotations(self, break_obj):
|
def draw_break_annotations(self, obj):
|
||||||
x_offset = self.raw_width / 2
|
x_offset = self.raw_width / 2
|
||||||
y_offset = self.raw_height / 2
|
y_offset = self.raw_height / 2
|
||||||
|
|
||||||
matrix_world = break_obj.matrix_world
|
classes = self.get_attribute_classes(obj)
|
||||||
for polygon in break_obj.data.polygons:
|
matrix_world = obj.matrix_world
|
||||||
points = [break_obj.data.vertices[v] for v in polygon.vertices]
|
for edge in obj.data.edges:
|
||||||
|
points = [obj.data.vertices[v] for v in edge.vertices]
|
||||||
projected_points = [self.project_point_onto_camera(matrix_world @ p.co.xyz) for p in points]
|
projected_points = [self.project_point_onto_camera(matrix_world @ p.co.xyz) for p in points]
|
||||||
|
projected_points = [projected_points[0], (projected_points[0] + projected_points[1]) / 2, projected_points[1]]
|
||||||
d = " ".join(
|
d = " ".join(
|
||||||
[
|
[
|
||||||
"L {} {}".format((x_offset + p.x) * self.scale, (y_offset - p.y) * self.scale)
|
"L {} {}".format((x_offset + p.x) * self.scale, (y_offset - p.y) * self.scale)
|
||||||
@@ -572,18 +574,8 @@ class SvgWriter:
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
d = "M{}".format(d[1:])
|
d = "M{}".format(d[1:])
|
||||||
path = self.svg.add(self.svg.path(d=d, class_=" ".join(["break"])))
|
path = self.svg.add(self.svg.path(d=d, class_=" ".join(classes)))
|
||||||
|
|
||||||
break_points = [
|
|
||||||
projected_points[0],
|
|
||||||
((projected_points[1] - projected_points[0]) / 2) + projected_points[0],
|
|
||||||
projected_points[1],
|
|
||||||
]
|
|
||||||
d = " ".join(
|
|
||||||
["L {} {}".format((x_offset + p.x) * self.scale, (y_offset - p.y) * self.scale) for p in break_points]
|
|
||||||
)
|
|
||||||
d = "M{}".format(d[1:])
|
|
||||||
path = self.svg.add(self.svg.path(d=d, class_=" ".join(["breakline"])))
|
|
||||||
|
|
||||||
def draw_plan_level_annotation(self, obj):
|
def draw_plan_level_annotation(self, obj):
|
||||||
x_offset = self.raw_width / 2
|
x_offset = self.raw_width / 2
|
||||||
|
|||||||
@@ -361,10 +361,14 @@ class BIM_PT_annotation_utilities(Panel):
|
|||||||
op = row.operator("bim.add_annotation", text="Breakline", icon="FCURVE")
|
op = row.operator("bim.add_annotation", text="Breakline", icon="FCURVE")
|
||||||
op.object_type = "BREAKLINE"
|
op.object_type = "BREAKLINE"
|
||||||
op.data_type = "mesh"
|
op.data_type = "mesh"
|
||||||
op = row.operator("bim.add_annotation", text="Misc", icon="MESH_MONKEY")
|
op = row.operator("bim.add_annotation", text="Line", icon="MESH_MONKEY")
|
||||||
op.object_type = "MISC"
|
op.object_type = "LINEWORK"
|
||||||
op.data_type = "mesh"
|
op.data_type = "mesh"
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
|
op = row.operator("bim.add_annotation", text="Fill Area", icon="NODE_TEXTURE")
|
||||||
|
op.object_type = "FILL_AREA"
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(self.props, "should_draw_decorations", text="Viewport Annotations")
|
row.prop(self.props, "should_draw_decorations", text="Viewport Annotations")
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,11 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
"PLAN_LEVEL": "curve",
|
"PLAN_LEVEL": "curve",
|
||||||
"SECTION_LEVEL": "curve",
|
"SECTION_LEVEL": "curve",
|
||||||
"BREAKLINE": "mesh",
|
"BREAKLINE": "mesh",
|
||||||
"MISC": "mesh",
|
"FILL_AREA": "mesh",
|
||||||
|
"LINEWORK": "mesh",
|
||||||
}[object_type]
|
}[object_type]
|
||||||
obj = annotation.Annotator.get_annotation_obj(object_type, data_type)
|
obj = annotation.Annotator.get_annotation_obj(object_type, data_type)
|
||||||
if object_type == "BREAKLINE":
|
if object_type == "FILL_AREA":
|
||||||
obj = annotation.Annotator.add_plane_to_annotation(obj)
|
obj = annotation.Annotator.add_plane_to_annotation(obj)
|
||||||
elif object_type != "TEXT":
|
elif object_type != "TEXT":
|
||||||
obj = annotation.Annotator.add_line_to_annotation(obj)
|
obj = annotation.Annotator.add_line_to_annotation(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user