mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
You can now select geometry library in advanced settings
This commit is contained in:
@@ -715,9 +715,17 @@ class IfcImporter:
|
|||||||
if not products:
|
if not products:
|
||||||
return results
|
return results
|
||||||
if tool.Loader.settings.should_use_cpu_multiprocessing:
|
if tool.Loader.settings.should_use_cpu_multiprocessing:
|
||||||
iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=products)
|
iterator = ifcopenshell.geom.iterator(
|
||||||
|
settings,
|
||||||
|
self.file,
|
||||||
|
multiprocessing.cpu_count(),
|
||||||
|
include=products,
|
||||||
|
geometry_library=self.ifc_import_settings.geometry_library,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
iterator = ifcopenshell.geom.iterator(settings, self.file, include=products)
|
iterator = ifcopenshell.geom.iterator(
|
||||||
|
settings, self.file, include=products, geometry_library=self.ifc_import_settings.geometry_library
|
||||||
|
)
|
||||||
if self.ifc_import_settings.should_cache:
|
if self.ifc_import_settings.should_cache:
|
||||||
cache = IfcStore.get_cache()
|
cache = IfcStore.get_cache()
|
||||||
if cache:
|
if cache:
|
||||||
@@ -1473,6 +1481,7 @@ class IfcImportSettings:
|
|||||||
self.logger: logging.Logger = None
|
self.logger: logging.Logger = None
|
||||||
self.input_file = None
|
self.input_file = None
|
||||||
self.diff_file = None
|
self.diff_file = None
|
||||||
|
self.geometry_library = "opencascade"
|
||||||
self.should_use_cpu_multiprocessing = True
|
self.should_use_cpu_multiprocessing = True
|
||||||
self.should_merge_materials_by_colour = False
|
self.should_merge_materials_by_colour = False
|
||||||
self.should_load_geometry = True
|
self.should_load_geometry = True
|
||||||
@@ -1508,6 +1517,7 @@ class IfcImportSettings:
|
|||||||
logger = logging.getLogger("ImportIFC")
|
logger = logging.getLogger("ImportIFC")
|
||||||
settings.logger = logger
|
settings.logger = logger
|
||||||
settings.diff_file = scene_diff.diff_json_file
|
settings.diff_file = scene_diff.diff_json_file
|
||||||
|
settings.geometry_library = props.geometry_library
|
||||||
settings.should_use_cpu_multiprocessing = props.should_use_cpu_multiprocessing
|
settings.should_use_cpu_multiprocessing = props.should_use_cpu_multiprocessing
|
||||||
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
||||||
settings.should_load_geometry = props.should_load_geometry
|
settings.should_load_geometry = props.should_load_geometry
|
||||||
|
|||||||
@@ -143,6 +143,15 @@ class BIMProjectProperties(PropertyGroup):
|
|||||||
active_filter_category_index: IntProperty(name="Active Filter Category Index")
|
active_filter_category_index: IntProperty(name="Active Filter Category Index")
|
||||||
filter_query: StringProperty(name="Filter Query")
|
filter_query: StringProperty(name="Filter Query")
|
||||||
should_filter_spatial_elements: BoolProperty(name="Filter Spatial Elements", default=False)
|
should_filter_spatial_elements: BoolProperty(name="Filter Spatial Elements", default=False)
|
||||||
|
geometry_library: bpy.props.EnumProperty(
|
||||||
|
items=[
|
||||||
|
("opencascade", "OpenCASCADE", "Best for stability and accuracy"),
|
||||||
|
("cgal", "CGAL", "Best for speed"),
|
||||||
|
("cgal-simple", "CGAL Simple", "CGAL without booleans"),
|
||||||
|
("hybrid-cgal-simple-opencascade", "Hybrid CGAL-OCC", "First CGAL then fallback to OCC"),
|
||||||
|
],
|
||||||
|
name="Geometry Library",
|
||||||
|
)
|
||||||
should_use_cpu_multiprocessing: BoolProperty(name="CPU Multiprocessing", default=True)
|
should_use_cpu_multiprocessing: BoolProperty(name="CPU Multiprocessing", default=True)
|
||||||
should_merge_materials_by_colour: BoolProperty(name="Merge Materials by Colour", default=False)
|
should_merge_materials_by_colour: BoolProperty(name="Merge Materials by Colour", default=False)
|
||||||
should_stream: BoolProperty(name="Stream Data From IFC-SPF (Only for advanced users)", default=False)
|
should_stream: BoolProperty(name="Stream Data From IFC-SPF (Only for advanced users)", default=False)
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ class BIM_PT_project(Panel):
|
|||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(pprops, "should_merge_materials_by_colour")
|
row.prop(pprops, "should_merge_materials_by_colour")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
|
row.prop(pprops, "geometry_library")
|
||||||
|
row = self.layout.row()
|
||||||
row.prop(pprops, "deflection_tolerance")
|
row.prop(pprops, "deflection_tolerance")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(pprops, "angular_tolerance")
|
row.prop(pprops, "angular_tolerance")
|
||||||
|
|||||||
Reference in New Issue
Block a user