Compare commits

..

4 Commits

Author SHA1 Message Date
Thomas Krijnen d5d1b3567b Update draw.py --include-curves 2023-08-10 15:44:21 +08:00
Kristoffer Andersen 7827ce3448 Update build.sh
fix env var declaration
2023-08-10 08:22:07 +02:00
Kristoffer Andersen a05059db01 Update build.sh
Reduce number of schema versions
2023-08-10 08:06:38 +02:00
Thomas Krijnen b78490ca56 #3510 Sample points along diagonal as well for quick and dirty occlusion detection 2023-08-10 10:52:06 +08:00
5 changed files with 12 additions and 18 deletions
+2
View File
@@ -12,6 +12,8 @@ if [ `uname` == Darwin ]; then
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
fi
export SCHEMA_VERSIONS="2x3;4;4x3;4x3_add1"
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
@@ -115,7 +115,6 @@ def switch_representation(
geometry.change_object_data(obj, data, is_global=is_global)
geometry.record_object_materials(obj)
geometry.remove_triangulation(obj)
if should_reload and existing_data:
geometry.delete_data(existing_data)
@@ -31,7 +31,6 @@ import blenderbim.bim.import_ifc
from math import radians
from mathutils import Vector
from blenderbim.bim.ifc import IfcStore
from math import radians
class Geometry(blenderbim.core.tool.Geometry):
@@ -546,19 +545,6 @@ class Geometry(blenderbim.core.tool.Geometry):
def rename_object(cls, obj, name):
obj.name = name
@classmethod
def remove_triangulation(cls, obj):
"""
Convert triangles to quads without bpy.ops.
Note that it uses bmesh based on object mesh.
"""
mesh = obj.data
bm = tool.Blender.get_bmesh_for_mesh(mesh)
# angle values come from defaults for `bpy.ops.mesh.tris_convert_to_quads()``
bmesh.ops.join_triangles(bm, faces=bm.faces[:], angle_face_threshold=radians(40), angle_shape_threshold=radians(40))
bm.normal_update()
tool.Blender.apply_bmesh(mesh, bm, obj)
@classmethod
def replace_object_with_empty(cls, obj):
element = tool.Ifc.get_entity(obj)
@@ -60,6 +60,7 @@ class draw_settings:
merge_cells: bool = False
include_projection: bool = True
prefilter: bool = True
include_curves: bool = False
def main(settings, files, iterators=None, merge_projection=True, progress_function=DO_NOTHING):
@@ -68,6 +69,7 @@ def main(settings, files, iterators=None, merge_projection=True, progress_functi
# this is required for serialization
APPLY_DEFAULT_MATERIALS=True,
DISABLE_TRIANGULATION=True,
INCLUDE_CURVES=settings.include_curves,
# when not doing booleans, proper solids from shells isn't a requirement
SEW_SHELLS=settings.subtract_before_hlr,
)
+8 -3
View File
@@ -309,11 +309,16 @@ namespace {
}
} else {
gp_Pnt2d tmp;
for (int i = 0; i < 4; ++i) {
// 0,1,2,3 -> interp over bounding box edges (i%4, (i+1)%4)
// 4,5 -> interp over bounding box diagonals (i%4, (i+2)%4)
// @todo use boolean_utils.h points_on_planar_face_generator?
// ... or skip faces with inner bounds all together ?
// ... ?
for (int i = 0; i < 6; ++i) {
// @todo proper edge intersection
for (int j = 0; j < 16; ++j) {
const gp_Pnt2d& a = *loop[i];
const gp_Pnt2d& b = *loop[(i + 1) % 4];
const gp_Pnt2d& a = *loop[i % 4];
const gp_Pnt2d& b = *loop[(i + (i >= 4 ? 2 : 1)) % 4];
interp(a, b, j / 16.0, tmp);
if (fclass->Perform(tmp) == TopAbs_OUT) {
return false;