mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
small fix on 36b4225b1
This commit is contained in:
@@ -569,16 +569,16 @@ class DumbWallGenerator:
|
||||
bpy.context.scene.grease_pencil.layers.remove(layer)
|
||||
return objs
|
||||
|
||||
def create_wall_from_2_points(self, coords, round=False):
|
||||
def create_wall_from_2_points(self, coords, should_round=False):
|
||||
direction = coords[1] - coords[0]
|
||||
length = direction.length
|
||||
if length < 0.1:
|
||||
if round(length, 4) < 0.1:
|
||||
return
|
||||
data = {"coords": coords}
|
||||
|
||||
self.length = length
|
||||
self.rotation = math.atan2(direction[1], direction[0])
|
||||
if round:
|
||||
if should_round:
|
||||
# Round to nearest 50mm (yes, metric for now)
|
||||
self.length = 0.05 * round(length / 0.05)
|
||||
# Round to nearest 5 degrees
|
||||
|
||||
@@ -140,13 +140,11 @@ class Snap(bonsai.core.tool.Snap):
|
||||
for point in polyline_data[1:]: # The first can be repeated to form a wall loop
|
||||
if (x, y, z) == (point.x, point.y, point.z):
|
||||
return "Cannot create two points at the same location"
|
||||
print(type(snap_vertex))
|
||||
print(type(polyline_data[-1]))
|
||||
# Avoids creating segments smaller then 0.1. This is a limitation from create_wall_from_2_points
|
||||
length = (
|
||||
Vector((x, y, z)) - Vector((polyline_data[-1].x, polyline_data[-1].y, polyline_data[-1].z))
|
||||
).length
|
||||
if length < 0.1:
|
||||
if round(length, 4) < 0.1:
|
||||
return "Cannot create a segment smaller then 10cm"
|
||||
|
||||
polyline_point = bpy.context.scene.BIMPolylineProperties.polyline_point.add()
|
||||
|
||||
Reference in New Issue
Block a user