mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
black .
This commit is contained in:
@@ -620,7 +620,7 @@ class DumbWallGenerator:
|
|||||||
walls = []
|
walls = []
|
||||||
for i in range(len(polyline_points) - 1):
|
for i in range(len(polyline_points) - 1):
|
||||||
vec1 = polyline_points[i]
|
vec1 = polyline_points[i]
|
||||||
vec2 = polyline_points[i+1]
|
vec2 = polyline_points[i + 1]
|
||||||
coords = (vec1, vec2)
|
coords = (vec1, vec2)
|
||||||
walls.append(self.create_wall_from_2_points(coords))
|
walls.append(self.create_wall_from_2_points(coords))
|
||||||
return walls
|
return walls
|
||||||
|
|||||||
@@ -373,10 +373,12 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
if polyline_points:
|
if polyline_points:
|
||||||
snap_points = tool.Raycast.ray_cast_to_polyline(context, event)
|
snap_points = tool.Raycast.ray_cast_to_polyline(context, event)
|
||||||
if snap_points:
|
if snap_points:
|
||||||
detected_snaps.append({
|
detected_snaps.append(
|
||||||
"group": "Polyline",
|
{
|
||||||
"points": snap_points,
|
"group": "Polyline",
|
||||||
})
|
"points": snap_points,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# Measure
|
# Measure
|
||||||
measure_data = context.scene.BIMPolylineProperties.measurement_polyline
|
measure_data = context.scene.BIMPolylineProperties.measurement_polyline
|
||||||
@@ -384,10 +386,12 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
measure_points = measure.polyline_points
|
measure_points = measure.polyline_points
|
||||||
snap_points = tool.Raycast.ray_cast_to_measure(context, event, measure_points)
|
snap_points = tool.Raycast.ray_cast_to_measure(context, event, measure_points)
|
||||||
if snap_points:
|
if snap_points:
|
||||||
detected_snaps.append({
|
detected_snaps.append(
|
||||||
"group": "Measure",
|
{
|
||||||
"points": snap_points,
|
"group": "Measure",
|
||||||
})
|
"points": snap_points,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# Edge-Vertex
|
# Edge-Vertex
|
||||||
for obj in objs_to_raycast:
|
for obj in objs_to_raycast:
|
||||||
@@ -395,11 +399,13 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
if len(obj.data.polygons) == 0:
|
if len(obj.data.polygons) == 0:
|
||||||
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, obj)
|
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, obj)
|
||||||
if snap_points:
|
if snap_points:
|
||||||
detected_snaps.append({
|
detected_snaps.append(
|
||||||
"group": "Edge-Vertex",
|
{
|
||||||
"object": obj,
|
"group": "Edge-Vertex",
|
||||||
"points": snap_points,
|
"object": obj,
|
||||||
})
|
"points": snap_points,
|
||||||
|
}
|
||||||
|
)
|
||||||
if obj.type == "EMPTY":
|
if obj.type == "EMPTY":
|
||||||
snap_point = {
|
snap_point = {
|
||||||
"points": [{"type": "Vertex", "point": obj.location}],
|
"points": [{"type": "Vertex", "point": obj.location}],
|
||||||
@@ -480,7 +486,7 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def select_snapping_points(cls, context, event, tool_state, detected_snaps):
|
def select_snapping_points(cls, context, event, tool_state, detected_snaps):
|
||||||
snapping_points = []
|
snapping_points = []
|
||||||
edges = [] # Get edges to create edge-intersection snap
|
edges = [] # Get edges to create edge-intersection snap
|
||||||
for snap_group in detected_snaps:
|
for snap_group in detected_snaps:
|
||||||
snap_obj = None
|
snap_obj = None
|
||||||
if snap_group["group"] == "Polyline":
|
if snap_group["group"] == "Polyline":
|
||||||
|
|||||||
Reference in New Issue
Block a user