Merge branch 'v0.6.0' of github.com:IfcOpenShell/IfcOpenShell into v0.6.0

This commit is contained in:
Dion Moult
2020-12-29 22:49:28 +11:00
2 changed files with 23 additions and 6 deletions
@@ -403,6 +403,8 @@ class EqualityDecorator(DimensionDecorator):
p0 = location_3d_to_region_2d(region, region3d, v0)
p1 = location_3d_to_region_2d(region, region3d, v1)
dir = p1 - p0
if dir.length < 1:
continue
self.draw_label("EQ", p0 + (dir) * .5, dir)
@@ -617,6 +619,8 @@ class LevelDecorator(BaseDecorator):
"""
for spline in obj.data.splines:
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]
def decorate(self, obj):
@@ -691,6 +695,8 @@ class PlanDecorator(LevelDecorator):
p0 = location_3d_to_region_2d(region, region3d, v0)
p1 = location_3d_to_region_2d(region, region3d, v1)
dir = p1 - p0
if dir.length < 1:
continue
text = "RL " + self.format_value(verts[-1].z)
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)) {
discard;
} 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)
p1 = location_3d_to_region_2d(region, region3d, v1)
dir = p1 - p0
if dir.length < 1:
continue
text = "RL " + self.format_value(verts[-1].z)
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]
collection = bpy.data.collections.get("IfcGroup/" + drawing.name)
for coll in bpy.data.collections:
if coll.name.startswith('IfcGrid'):
for obj in coll.all_objects:
if obj.type == 'MESH':
collection.objects.link(obj.copy())
existing = [obj for obj in collection.objects if obj.name.startswith('IfcGridAxis')]
for obj in existing:
collection.objects.unlink(obj)
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"}