mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 18:12:28 +00:00
Merge branch 'v0.6.0' of github.com:IfcOpenShell/IfcOpenShell into v0.6.0
This commit is contained in:
@@ -403,6 +403,8 @@ class EqualityDecorator(DimensionDecorator):
|
|||||||
p0 = location_3d_to_region_2d(region, region3d, v0)
|
p0 = location_3d_to_region_2d(region, region3d, v0)
|
||||||
p1 = location_3d_to_region_2d(region, region3d, v1)
|
p1 = location_3d_to_region_2d(region, region3d, v1)
|
||||||
dir = p1 - p0
|
dir = p1 - p0
|
||||||
|
if dir.length < 1:
|
||||||
|
continue
|
||||||
self.draw_label("EQ", p0 + (dir) * .5, dir)
|
self.draw_label("EQ", p0 + (dir) * .5, dir)
|
||||||
|
|
||||||
|
|
||||||
@@ -617,6 +619,8 @@ class LevelDecorator(BaseDecorator):
|
|||||||
"""
|
"""
|
||||||
for spline in obj.data.splines:
|
for spline in obj.data.splines:
|
||||||
spline_points = spline.bezier_points if spline.bezier_points else spline.points
|
spline_points = spline.bezier_points if spline.bezier_points else spline.points
|
||||||
|
if len(spline_points) < 2:
|
||||||
|
continue
|
||||||
yield [obj.matrix_world @ p.co for p in spline_points]
|
yield [obj.matrix_world @ p.co for p in spline_points]
|
||||||
|
|
||||||
def decorate(self, obj):
|
def decorate(self, obj):
|
||||||
@@ -691,6 +695,8 @@ class PlanDecorator(LevelDecorator):
|
|||||||
p0 = location_3d_to_region_2d(region, region3d, v0)
|
p0 = location_3d_to_region_2d(region, region3d, v0)
|
||||||
p1 = location_3d_to_region_2d(region, region3d, v1)
|
p1 = location_3d_to_region_2d(region, region3d, v1)
|
||||||
dir = p1 - p0
|
dir = p1 - p0
|
||||||
|
if dir.length < 1:
|
||||||
|
continue
|
||||||
text = "RL " + self.format_value(verts[-1].z)
|
text = "RL " + self.format_value(verts[-1].z)
|
||||||
self.draw_label(text, p0, dir, gap=8, center=False)
|
self.draw_label(text, p0, dir, gap=8, center=False)
|
||||||
|
|
||||||
@@ -750,7 +756,7 @@ class SectionDecorator(LevelDecorator):
|
|||||||
if (t > 0.875 || (t > 0.25 && t < 0.375)) {
|
if (t > 0.875 || (t > 0.25 && t < 0.375)) {
|
||||||
discard;
|
discard;
|
||||||
} else {
|
} else {
|
||||||
fragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
fragColor = COLOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -764,5 +770,7 @@ class SectionDecorator(LevelDecorator):
|
|||||||
p0 = location_3d_to_region_2d(region, region3d, v0)
|
p0 = location_3d_to_region_2d(region, region3d, v0)
|
||||||
p1 = location_3d_to_region_2d(region, region3d, v1)
|
p1 = location_3d_to_region_2d(region, region3d, v1)
|
||||||
dir = p1 - p0
|
dir = p1 - p0
|
||||||
|
if dir.length < 1:
|
||||||
|
continue
|
||||||
text = "RL " + self.format_value(verts[-1].z)
|
text = "RL " + self.format_value(verts[-1].z)
|
||||||
self.draw_label(text, p0 + dir.normalized() * 16, -dir, gap=16, center=False)
|
self.draw_label(text, p0 + dir.normalized() * 16, -dir, gap=16, center=False)
|
||||||
|
|||||||
@@ -4678,9 +4678,18 @@ class CopyGrid(bpy.types.Operator):
|
|||||||
drawing = props.drawings[props.active_drawing_index]
|
drawing = props.drawings[props.active_drawing_index]
|
||||||
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
|
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
|
||||||
|
|
||||||
for coll in bpy.data.collections:
|
existing = [obj for obj in collection.objects if obj.name.startswith('IfcGridAxis')]
|
||||||
if coll.name.startswith('IfcGrid'):
|
for obj in existing:
|
||||||
for obj in coll.all_objects:
|
collection.objects.unlink(obj)
|
||||||
if obj.type == 'MESH':
|
|
||||||
collection.objects.link(obj.copy())
|
source = [obj
|
||||||
|
for coll in bpy.data.collections
|
||||||
|
if coll.name.startswith('IfcGrid')
|
||||||
|
for obj in coll.all_objects
|
||||||
|
if obj.type == 'MESH']
|
||||||
|
for obj in source:
|
||||||
|
dstobj = obj.copy()
|
||||||
|
dstobj.data = dstobj.data.copy()
|
||||||
|
collection.objects.link(dstobj)
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user