mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Minor fix to 12DToRevitTINS patch
This commit is contained in:
@@ -15,10 +15,10 @@ class Patcher:
|
|||||||
# The solution will merge vertices closer than 10mm to prevent dense
|
# The solution will merge vertices closer than 10mm to prevent dense
|
||||||
# portions of the TIN at a minor sacrifice of surveying accuracy. It
|
# portions of the TIN at a minor sacrifice of surveying accuracy. It
|
||||||
# will also triangulate all meshes to prevent non-coplanar surfaces, and
|
# will also triangulate all meshes to prevent non-coplanar surfaces, and
|
||||||
# delete any obtuse triangles where one of their angles is less than 0.3
|
# delete any obtuse triangles where one of their XY angles is less than
|
||||||
# degrees. Therefore the result will contain some minor "holes" in the
|
# 0.3 degrees. Therefore the result will contain some minor "holes" in
|
||||||
# TIN, but these holes will only be in dense triangles that Revit can't
|
# the TIN, but these holes will only be in dense triangles that Revit
|
||||||
# handle anyway and won't affect most coordination tasks.
|
# can't handle anyway and won't affect most coordination tasks.
|
||||||
#
|
#
|
||||||
# This patch is designed to only work on 12D IFC exports. It also
|
# This patch is designed to only work on 12D IFC exports. It also
|
||||||
# requires you to run it using Blender, as the geometric modification
|
# requires you to run it using Blender, as the geometric modification
|
||||||
@@ -47,7 +47,7 @@ class Patcher:
|
|||||||
bmesh.ops.triangulate(bm, faces=bm.faces[:], quad_method='BEAUTY', ngon_method='BEAUTY')
|
bmesh.ops.triangulate(bm, faces=bm.faces[:], quad_method='BEAUTY', ngon_method='BEAUTY')
|
||||||
bm.faces.ensure_lookup_table()
|
bm.faces.ensure_lookup_table()
|
||||||
for polygon in bm.faces:
|
for polygon in bm.faces:
|
||||||
v1, v2, v3 = [v.co for v in polygon.verts]
|
v1, v2, v3 = [v.co.to_2d() for v in polygon.verts]
|
||||||
d1 = degrees((v2-v1).angle(v3-v1))
|
d1 = degrees((v2-v1).angle(v3-v1))
|
||||||
d2 = degrees((v3-v2).angle(v1-v2))
|
d2 = degrees((v3-v2).angle(v1-v2))
|
||||||
d3 = degrees((v1-v3).angle(v2-v3))
|
d3 = degrees((v1-v3).angle(v2-v3))
|
||||||
|
|||||||
Reference in New Issue
Block a user