mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
black .
This commit is contained in:
+17
-13
@@ -358,7 +358,7 @@ yacc = "yacc" # Used during swig building process, installed with `bison` on De
|
||||
missing_commands: "list[str]" = []
|
||||
required_commands = [git, bunzip2, tar, cc, cplusplus, autoconf, automake, make, "patch", "cmake", yacc, xz]
|
||||
if "wasm" in flags:
|
||||
required_commands.remove(yacc) # yacc not needed for wasm builds
|
||||
required_commands.remove(yacc) # yacc not needed for wasm builds
|
||||
for cmd in required_commands:
|
||||
if which(cmd) is None:
|
||||
missing_commands.append(cmd)
|
||||
@@ -932,7 +932,7 @@ if "libxml2" in targets:
|
||||
if MAC_CROSS_COMPILE_INTEL:
|
||||
OLD_CC = os.environ.get("CC")
|
||||
os.environ["CC"] = MAC_CROSS_COMPILE_INTEL_CC
|
||||
build_tool_args=[
|
||||
build_tool_args = [
|
||||
"--without-python",
|
||||
ENABLE_FLAG,
|
||||
DISABLE_FLAG,
|
||||
@@ -1258,21 +1258,25 @@ if "cgal" in targets:
|
||||
cmake_args_prefix_path.append(f"{DEPS_DIR}/install/gmp-{GMP_VERSION}")
|
||||
cmake_args_prefix_path.append(f"{DEPS_DIR}/install/mpfr-{MPFR_VERSION}")
|
||||
if "wasm" in flags:
|
||||
cmake_args.extend([
|
||||
f"-DCGAL_INCLUDE_DIR={DEPS_DIR}/install/cgal-{CGAL_VERSION}/include",
|
||||
f"-DGMP_INCLUDE_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/include",
|
||||
f"-DGMP_LIBRARY_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/lib",
|
||||
f"-DMPFR_INCLUDE_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/include",
|
||||
f"-DMPFR_LIBRARY_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib",
|
||||
])
|
||||
cmake_args.extend(
|
||||
[
|
||||
f"-DCGAL_INCLUDE_DIR={DEPS_DIR}/install/cgal-{CGAL_VERSION}/include",
|
||||
f"-DGMP_INCLUDE_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/include",
|
||||
f"-DGMP_LIBRARY_DIR={DEPS_DIR}/install/gmp-{GMP_VERSION}/lib",
|
||||
f"-DMPFR_INCLUDE_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/include",
|
||||
f"-DMPFR_LIBRARY_DIR={DEPS_DIR}/install/mpfr-{MPFR_VERSION}/lib",
|
||||
]
|
||||
)
|
||||
|
||||
if "occ" in targets and USE_OCCT:
|
||||
cmake_args_prefix_path.append(f"{DEPS_DIR}/install/occt-{OCCT_VERSION}")
|
||||
if "wasm" in flags:
|
||||
cmake_args.extend([
|
||||
f"-DOCC_INCLUDE_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}/include/opencascade",
|
||||
f"-DOCC_LIBRARY_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}/lib",
|
||||
])
|
||||
cmake_args.extend(
|
||||
[
|
||||
f"-DOCC_INCLUDE_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}/include/opencascade",
|
||||
f"-DOCC_LIBRARY_DIR={DEPS_DIR}/install/occt-{OCCT_VERSION}/lib",
|
||||
]
|
||||
)
|
||||
|
||||
elif "occ" in targets:
|
||||
# We don't support find_package for OCE.
|
||||
|
||||
@@ -486,7 +486,7 @@ class Project(bonsai.core.tool.Project):
|
||||
|
||||
@classmethod
|
||||
def get_clipping_planes_normals(cls):
|
||||
normals =[]
|
||||
normals = []
|
||||
for clipping_plane in tool.Project.get_project_props().clipping_planes:
|
||||
plane = clipping_plane.obj
|
||||
if not plane or not plane.data:
|
||||
@@ -502,4 +502,3 @@ class Project(bonsai.core.tool.Project):
|
||||
d2 = v3 - v2
|
||||
normals.append((v1, d1.cross(d2).normalized()))
|
||||
return normals
|
||||
|
||||
|
||||
@@ -165,7 +165,6 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_viewport_ray_data(
|
||||
cls, context: bpy.types.Context, event: bpy.types.Event, mouse_pos: tuple[int, int] = None
|
||||
@@ -455,7 +454,7 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
if tool.Raycast.intersect_mouse_2d_bounding_box(mouse_pos, bbox_2d):
|
||||
if tool.Raycast.object_is_visible_in_clipping_plane(obj):
|
||||
objs_to_raycast.append(obj)
|
||||
|
||||
|
||||
return objs_to_raycast
|
||||
|
||||
@classmethod
|
||||
@@ -544,4 +543,3 @@ class Raycast(bonsai.core.tool.Raycast):
|
||||
if lens < 50:
|
||||
snap_threshold *= value
|
||||
return snap_threshold
|
||||
|
||||
|
||||
@@ -491,7 +491,11 @@ class Snap(bonsai.core.tool.Snap):
|
||||
"distance": 10, # High value so it has low priority
|
||||
}
|
||||
detected_snaps.append(snap_point)
|
||||
detected_snaps = [snap for snap in detected_snaps if (tool.Raycast.point_is_visible_in_clipping_plane(snap["point"]) or snap["group"] == "Plane")]
|
||||
detected_snaps = [
|
||||
snap
|
||||
for snap in detected_snaps
|
||||
if (tool.Raycast.point_is_visible_in_clipping_plane(snap["point"]) or snap["group"] == "Plane")
|
||||
]
|
||||
return detected_snaps
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -185,7 +185,7 @@ def open(
|
||||
return sqlite(path)
|
||||
if should_stream:
|
||||
return stream(path)
|
||||
if readonly: # Temporary conditional see #7131. Remove once newer builds don't segfault on Linux.
|
||||
if readonly: # Temporary conditional see #7131. Remove once newer builds don't segfault on Linux.
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()), readonly)
|
||||
else:
|
||||
f = ifcopenshell_wrapper.open(str(path.absolute()))
|
||||
|
||||
@@ -442,7 +442,7 @@ class Html(Json):
|
||||
def report(self) -> None:
|
||||
super().report()
|
||||
for spec in self.results["specifications"]:
|
||||
print('checking', spec["cardinality"])
|
||||
print("checking", spec["cardinality"])
|
||||
if spec["cardinality"] == "optional" and spec["total_checks"] == 0:
|
||||
spec["is_skipped"] = True
|
||||
spec["is_prohibited"] = spec["cardinality"] == "prohibited"
|
||||
|
||||
Reference in New Issue
Block a user