mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 22:16:41 +00:00
Remove deprecated STRICT_TOLERANCE setting #4832
Mentioned in #4565, it's now "set" by default
This commit is contained in:
@@ -100,7 +100,6 @@ class IfcStore:
|
|||||||
ifc_hash = hashlib.md5(ifc_key.encode("utf-8")).hexdigest()
|
ifc_hash = hashlib.md5(ifc_key.encode("utf-8")).hexdigest()
|
||||||
IfcStore.cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
|
IfcStore.cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
|
||||||
cache_settings = ifcopenshell.geom.settings()
|
cache_settings = ifcopenshell.geom.settings()
|
||||||
cache_settings.set(cache_settings.STRICT_TOLERANCE, True)
|
|
||||||
try:
|
try:
|
||||||
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
|
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -400,7 +400,6 @@ class IfcImporter:
|
|||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
|
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
|
||||||
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
|
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
|
||||||
# settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
||||||
settings.set('context-ids', [context.id()])
|
settings.set('context-ids', [context.id()])
|
||||||
self.context_settings.append(settings)
|
self.context_settings.append(settings)
|
||||||
@@ -408,7 +407,6 @@ class IfcImporter:
|
|||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
|
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
|
||||||
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
|
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
|
||||||
# settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
|
||||||
settings.set('disable-opening-subtractions', True)
|
settings.set('disable-opening-subtractions', True)
|
||||||
settings.set('context-ids', [context.id()])
|
settings.set('context-ids', [context.id()])
|
||||||
|
|||||||
@@ -692,7 +692,6 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
tree = ifcopenshell.geom.tree()
|
tree = ifcopenshell.geom.tree()
|
||||||
shapes = {}
|
shapes = {}
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
|
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
|
||||||
iterator = ifcopenshell.geom.iterator(settings, tool.Ifc.get(), multiprocessing.cpu_count(), include=include)
|
iterator = ifcopenshell.geom.iterator(settings, tool.Ifc.get(), multiprocessing.cpu_count(), include=include)
|
||||||
if iterator.initialize():
|
if iterator.initialize():
|
||||||
@@ -831,7 +830,6 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
# Create shape of opening as a dissolved BMesh
|
# Create shape of opening as a dissolved BMesh
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
shape = ifcopenshell.geom.create_shape(settings, opening)
|
shape = ifcopenshell.geom.create_shape(settings, opening)
|
||||||
m = shape.transformation.matrix
|
m = shape.transformation.matrix
|
||||||
mat = Matrix(
|
mat = Matrix(
|
||||||
@@ -1033,7 +1031,6 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
if not element.is_a("IfcOpeningElement"):
|
if not element.is_a("IfcOpeningElement"):
|
||||||
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
|
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
# geometry = ifcopenshell.geom.create_shape(settings, body)
|
# geometry = ifcopenshell.geom.create_shape(settings, body)
|
||||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||||
m = shape.transformation.matrix
|
m = shape.transformation.matrix
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
if not context or not drawing_elements:
|
if not context or not drawing_elements:
|
||||||
continue
|
continue
|
||||||
geom_settings = ifcopenshell.geom.settings(
|
geom_settings = ifcopenshell.geom.settings(
|
||||||
DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True
|
DISABLE_TRIANGULATION=True, INCLUDE_CURVES=True
|
||||||
)
|
)
|
||||||
if ifc.by_id(context[0]).ContextType == "Plan" and "PLAN_VIEW" in target_view:
|
if ifc.by_id(context[0]).ContextType == "Plan" and "PLAN_VIEW" in target_view:
|
||||||
offset = ifcopenshell.ifcopenshell_wrapper.float_array_3()
|
offset = ifcopenshell.ifcopenshell_wrapper.float_array_3()
|
||||||
@@ -561,7 +561,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
if tool.Ifc.get() == ifc and self.camera_element not in drawing_elements:
|
if tool.Ifc.get() == ifc and self.camera_element not in drawing_elements:
|
||||||
with profile("Camera element"):
|
with profile("Camera element"):
|
||||||
# The camera must always be included, regardless of any include/exclude filters.
|
# The camera must always be included, regardless of any include/exclude filters.
|
||||||
geom_settings = ifcopenshell.geom.settings(DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True)
|
geom_settings = ifcopenshell.geom.settings(DISABLE_TRIANGULATION=True)
|
||||||
it = ifcopenshell.geom.iterator(geom_settings, ifc, include=[self.camera_element])
|
it = ifcopenshell.geom.iterator(geom_settings, ifc, include=[self.camera_element])
|
||||||
for elem in it:
|
for elem in it:
|
||||||
self.serialiser.write(elem)
|
self.serialiser.write(elem)
|
||||||
@@ -875,7 +875,7 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
|
|
||||||
def setup_serialiser(self, target_view):
|
def setup_serialiser(self, target_view):
|
||||||
self.svg_settings = ifcopenshell.geom.settings(
|
self.svg_settings = ifcopenshell.geom.settings(
|
||||||
DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True
|
DISABLE_TRIANGULATION=True, INCLUDE_CURVES=True
|
||||||
)
|
)
|
||||||
self.svg_buffer = ifcopenshell.geom.serializers.buffer()
|
self.svg_buffer = ifcopenshell.geom.serializers.buffer()
|
||||||
self.serialiser = ifcopenshell.geom.serializers.svg(self.svg_buffer, self.svg_settings)
|
self.serialiser = ifcopenshell.geom.serializers.svg(self.svg_buffer, self.svg_settings)
|
||||||
|
|||||||
@@ -644,7 +644,6 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def import_drawing(cls, drawing: ifcopenshell.entity_instance) -> bpy.types.Object:
|
def import_drawing(cls, drawing: ifcopenshell.entity_instance) -> bpy.types.Object:
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
|
|
||||||
camera_type = "ORTHO"
|
camera_type = "ORTHO"
|
||||||
body = ifcopenshell.util.representation.get_representation(drawing, "Model", "Body", "MODEL_VIEW")
|
body = ifcopenshell.util.representation.get_representation(drawing, "Model", "Body", "MODEL_VIEW")
|
||||||
|
|||||||
@@ -18,10 +18,8 @@ class BlenderImporter:
|
|||||||
self.settings = ifcopenshell.geom.settings()
|
self.settings = ifcopenshell.geom.settings()
|
||||||
self.settings.set_deflection_tolerance(self.deflection_tolerance)
|
self.settings.set_deflection_tolerance(self.deflection_tolerance)
|
||||||
self.settings.set_angular_tolerance(self.angular_tolerance)
|
self.settings.set_angular_tolerance(self.angular_tolerance)
|
||||||
self.settings.set(self.settings.STRICT_TOLERANCE, True)
|
|
||||||
self.settings_2d = ifcopenshell.geom.settings()
|
self.settings_2d = ifcopenshell.geom.settings()
|
||||||
self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True)
|
self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True)
|
||||||
self.settings_2d.set(self.settings.STRICT_TOLERANCE, True)
|
|
||||||
|
|
||||||
self.process_element_filter()
|
self.process_element_filter()
|
||||||
self.process_context_filter()
|
self.process_context_filter()
|
||||||
@@ -116,7 +114,6 @@ class BlenderImporter:
|
|||||||
|
|
||||||
def get_cache(self):
|
def get_cache(self):
|
||||||
cache_settings = ifcopenshell.geom.settings()
|
cache_settings = ifcopenshell.geom.settings()
|
||||||
cache_settings.set(cache_settings.STRICT_TOLERANCE, True)
|
|
||||||
try:
|
try:
|
||||||
return ifcopenshell.geom.serializers.hdf5(self.cache_path, cache_settings)
|
return ifcopenshell.geom.serializers.hdf5(self.cache_path, cache_settings)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ class IfcDiff:
|
|||||||
|
|
||||||
def get_settings(self, ifc):
|
def get_settings(self, ifc):
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
# Are you feeling lucky?
|
# Are you feeling lucky?
|
||||||
settings.set(settings.DISABLE_BOOLEAN_RESULT, True)
|
settings.set(settings.DISABLE_BOOLEAN_RESULT, True)
|
||||||
# Are you feeling very lucky?
|
# Are you feeling very lucky?
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ class Patcher:
|
|||||||
self.elements = self.file.by_type("IfcElement")
|
self.elements = self.file.by_type("IfcElement")
|
||||||
|
|
||||||
self.settings = ifcopenshell.geom.settings()
|
self.settings = ifcopenshell.geom.settings()
|
||||||
self.settings.set(self.settings.STRICT_TOLERANCE, True)
|
|
||||||
|
|
||||||
self.body_contexts = [
|
self.body_contexts = [
|
||||||
c.id()
|
c.id()
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ class Patcher:
|
|||||||
return
|
return
|
||||||
|
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
settings.set(settings.STRICT_TOLERANCE, True)
|
|
||||||
settings.set_context_ids([context.id()])
|
settings.set_context_ids([context.id()])
|
||||||
iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=elements)
|
iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=elements)
|
||||||
replacements = {}
|
replacements = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user