This commit is contained in:
Andrej730
2024-09-30 11:07:10 +05:00
parent 6e2e01b460
commit 9131804e4e
4 changed files with 10 additions and 9 deletions
@@ -749,9 +749,11 @@ class PolylinePoint(PropertyGroup):
angle: bpy.props.StringProperty(name="Angle")
position: bpy.props.FloatVectorProperty(name="Decorator Position", size=3)
class MeasurePolyline(PropertyGroup):
polyline_point: bpy.props.CollectionProperty(type=PolylinePoint)
class BIMPolylineProperties(PropertyGroup):
snap_mouse_point: bpy.props.CollectionProperty(type=SnapMousePoint)
snap_mouse_ref: bpy.props.CollectionProperty(type=SnapMousePoint)
+3 -4
View File
@@ -230,8 +230,8 @@ class Raycast(bonsai.core.tool.Raycast):
bm.verts.index_update()
bm.edges.index_update()
indices = list(range(len(points)-1))
edges = [(i, i+1) for i in range(len(points)-1)]
indices = list(range(len(points) - 1))
edges = [(i, i + 1) for i in range(len(points) - 1)]
new_verts = [bm.verts.new(Vector((point.x, point.y, point.z))) for point in points]
new_edges = [bm.edges.new((new_verts[e[0]], new_verts[e[1]])) for e in edges]
bm.verts.index_update()
@@ -239,8 +239,7 @@ class Raycast(bonsai.core.tool.Raycast):
snapping_points = cls.ray_cast_by_proximity(context, event, None, custom_bmesh=bm)
bm.free()
return snapping_points
return snapping_points
@classmethod
def ray_cast_to_plane(cls, context, event, plane_origin, plane_normal):
+3 -4
View File
@@ -168,7 +168,7 @@ class Snap(bonsai.core.tool.Snap):
measure_point.dim = point.dim
measure_point.angle = point.angle
measure_point.position = point.position
@classmethod
def snap_on_axis(cls, intersection, tool_state, lock_angle=False):
@@ -392,16 +392,15 @@ class Snap(bonsai.core.tool.Snap):
if snap_points:
detected_snaps.append({"Polyline": snap_points})
# Measure
# Measure
measure_data = context.scene.BIMPolylineProperties.measure_polyline
for measure in measure_data:
measure_points = measure.polyline_point
print('points', measure_points)
print("points", measure_points)
snap_points = tool.Raycast.ray_cast_to_measure(context, event, measure_points)
if snap_points:
detected_snaps.append({"Polyline": snap_points})
# Axis and Plane
elevation = tool.Ifc.get_object(tool.Root.get_default_container()).location.z
@@ -573,7 +573,8 @@ class serializers:
# ttl is always available since it doesn't depend on any C++ libraries,
# just people might be using an outdated binary
if hasattr(ifcopenshell_wrapper, 'TtlWktSerializer'):
if hasattr(ifcopenshell_wrapper, "TtlWktSerializer"):
@staticmethod
def ttl(
out_filename: Union[str, serializers.buffer], geometry_settings: settings, settings: serializer_settings