compas-brep 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- compas_brep/__init__.py +45 -0
- compas_brep/backend/__init__.py +50 -0
- compas_brep/backend/occ/__init__.py +22 -0
- compas_brep/backend/occ/conversion.py +1009 -0
- compas_brep/backend/occ/factories.py +312 -0
- compas_brep/backend/occ/io.py +72 -0
- compas_brep/backend/occ/operations.py +408 -0
- compas_brep/backend/occ/plugins.py +343 -0
- compas_brep/backend/occ/queries.py +161 -0
- compas_brep/backend/occ/topology.py +197 -0
- compas_brep/backend/rhino/__init__.py +19 -0
- compas_brep/backend/rhino/conversion.py +670 -0
- compas_brep/backend/rhino/factories.py +204 -0
- compas_brep/backend/rhino/io.py +92 -0
- compas_brep/backend/rhino/operations.py +358 -0
- compas_brep/backend/rhino/plugins.py +346 -0
- compas_brep/backend/rhino/topology.py +197 -0
- compas_brep/brep.py +888 -0
- compas_brep/curves/__init__.py +5 -0
- compas_brep/curves/nurbs.py +483 -0
- compas_brep/data/box_with_holes.stp +1719 -0
- compas_brep/data_example.py +121 -0
- compas_brep/edge.py +163 -0
- compas_brep/errors.py +25 -0
- compas_brep/face.py +196 -0
- compas_brep/loop.py +74 -0
- compas_brep/operations.py +295 -0
- compas_brep/py.typed +0 -0
- compas_brep/scene/__init__.py +0 -0
- compas_brep/scene/rhino/__init__.py +19 -0
- compas_brep/scene/rhino/brepobject.py +23 -0
- compas_brep/scene/rhino/curveobject.py +23 -0
- compas_brep/scene/rhino/surfaceobject.py +23 -0
- compas_brep/scene/viewer/__init__.py +28 -0
- compas_brep/scene/viewer/brepobject.py +47 -0
- compas_brep/scene/viewer/curveobject.py +39 -0
- compas_brep/scene/viewer/surfaceobject.py +168 -0
- compas_brep/surfaces/__init__.py +9 -0
- compas_brep/surfaces/_codec.py +67 -0
- compas_brep/surfaces/nurbs.py +772 -0
- compas_brep/trim.py +146 -0
- compas_brep/vertex.py +21 -0
- compas_brep-0.1.0.dist-info/METADATA +105 -0
- compas_brep-0.1.0.dist-info/RECORD +45 -0
- compas_brep-0.1.0.dist-info/WHEEL +4 -0
compas_brep/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""compas_brep: Pure Python Brep implementation based on the COMPAS framework."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.0"
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
from compas_brep.brep import Brep
|
|
8
|
+
from compas_brep.curves import NurbsCurve
|
|
9
|
+
from compas_brep.edge import BrepEdge
|
|
10
|
+
from compas_brep.errors import BrepError
|
|
11
|
+
from compas_brep.errors import BrepFilletError
|
|
12
|
+
from compas_brep.errors import BrepInvalidError
|
|
13
|
+
from compas_brep.errors import BrepTrimmingError
|
|
14
|
+
from compas_brep.face import BrepFace
|
|
15
|
+
from compas_brep.loop import BrepLoop
|
|
16
|
+
from compas_brep.surfaces import NurbsSurface
|
|
17
|
+
from compas_brep.trim import BrepTrim
|
|
18
|
+
from compas_brep.vertex import BrepVertex
|
|
19
|
+
|
|
20
|
+
DATA = os.path.join(os.path.dirname(__file__), "data")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__all_plugins__ = [
|
|
24
|
+
"compas_brep.scene",
|
|
25
|
+
"compas_brep.backend.occ.plugins",
|
|
26
|
+
"compas_brep.backend.rhino.plugins",
|
|
27
|
+
"compas_brep.scene.viewer",
|
|
28
|
+
"compas_brep.scene.rhino",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"DATA",
|
|
33
|
+
"Brep",
|
|
34
|
+
"BrepVertex",
|
|
35
|
+
"BrepEdge",
|
|
36
|
+
"BrepLoop",
|
|
37
|
+
"BrepFace",
|
|
38
|
+
"BrepTrim",
|
|
39
|
+
"NurbsCurve",
|
|
40
|
+
"NurbsSurface",
|
|
41
|
+
"BrepError",
|
|
42
|
+
"BrepInvalidError",
|
|
43
|
+
"BrepTrimmingError",
|
|
44
|
+
"BrepFilletError",
|
|
45
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Backend implementations for compas_brep.
|
|
2
|
+
|
|
3
|
+
This package contains pluggable backend sub-packages for different geometry kernels.
|
|
4
|
+
Each backend is a sub-package with logically split modules:
|
|
5
|
+
|
|
6
|
+
- **OCC** (``occ/``): Uses cadquery-ocp-novtk.
|
|
7
|
+
- ``occ/conversion.py`` — bidirectional OCC ↔ Brep conversion
|
|
8
|
+
- ``occ/factories.py`` — primitive constructors and shape builders
|
|
9
|
+
- ``occ/operations.py`` — boolean and geometric operations
|
|
10
|
+
- ``occ/queries.py`` — property queries and tessellation
|
|
11
|
+
- ``occ/io.py`` — STEP/STL/IGES import and export
|
|
12
|
+
- ``occ/plugins.py`` — COMPAS plugin registrations
|
|
13
|
+
|
|
14
|
+
- **Rhino** (``rhino/``): Uses Rhino.Geometry.
|
|
15
|
+
- ``rhino/conversion.py`` — bidirectional Rhino ↔ Brep conversion
|
|
16
|
+
- ``rhino/factories.py`` — primitive constructors and shape builders
|
|
17
|
+
- ``rhino/operations.py`` — boolean and geometric operations
|
|
18
|
+
- ``rhino/io.py`` — STEP import and export
|
|
19
|
+
- ``rhino/plugins.py`` — COMPAS plugin registrations
|
|
20
|
+
|
|
21
|
+
The plugin modules are only loaded by the COMPAS plugin system when the
|
|
22
|
+
corresponding kernel is available (``requires=["OCP"]`` or ``requires=["Rhino"]``).
|
|
23
|
+
They are **not** imported at package level so that ``compas_brep`` remains
|
|
24
|
+
importable in any environment.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from .occ.topology import OccBrepEdge as OccBrepEdge
|
|
28
|
+
from .occ.topology import OccBrepFace as OccBrepFace
|
|
29
|
+
from .occ.topology import OccBrepLoop as OccBrepLoop
|
|
30
|
+
from .occ.topology import OccBrepTrim as OccBrepTrim
|
|
31
|
+
from .occ.topology import OccBrepVertex as OccBrepVertex
|
|
32
|
+
from .rhino.topology import RhinoBrepEdge as RhinoBrepEdge
|
|
33
|
+
from .rhino.topology import RhinoBrepFace as RhinoBrepFace
|
|
34
|
+
from .rhino.topology import RhinoBrepLoop as RhinoBrepLoop
|
|
35
|
+
from .rhino.topology import RhinoBrepTrim as RhinoBrepTrim
|
|
36
|
+
from .rhino.topology import RhinoBrepVertex as RhinoBrepVertex
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
from .occ.conversion import brep_to_occ as brep_to_occ
|
|
40
|
+
from .occ.conversion import occ_to_brep as occ_to_brep
|
|
41
|
+
except ImportError:
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
from .rhino.conversion import brep_to_rhino as brep_to_rhino
|
|
46
|
+
from .rhino.conversion import nurbs_curve_to_rhino as nurbs_curve_to_rhino
|
|
47
|
+
from .rhino.conversion import nurbs_surface_to_rhino as nurbs_surface_to_rhino
|
|
48
|
+
from .rhino.conversion import rhino_to_brep as rhino_to_brep
|
|
49
|
+
except ImportError:
|
|
50
|
+
pass
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""OCC backend sub-package for compas_brep.
|
|
2
|
+
|
|
3
|
+
Modules
|
|
4
|
+
-------
|
|
5
|
+
conversion
|
|
6
|
+
Bidirectional conversion between canonical Brep data and OCC shapes
|
|
7
|
+
(``occ_to_brep``, ``brep_to_occ``, and all private helper functions).
|
|
8
|
+
factories
|
|
9
|
+
Primitive constructors and shape builders
|
|
10
|
+
(``make_box``, ``make_cylinder``, ``occ_sweep``, ``occ_from_surface``, …).
|
|
11
|
+
operations
|
|
12
|
+
Boolean and geometric operations
|
|
13
|
+
(``boolean_difference``, ``occ_trimmed``, ``occ_fillet``, ``occ_rebuild``, …).
|
|
14
|
+
queries
|
|
15
|
+
Property queries and tessellation
|
|
16
|
+
(``occ_area``, ``occ_aabb``, ``occ_tessellate``, …).
|
|
17
|
+
io
|
|
18
|
+
File import/export
|
|
19
|
+
(``occ_to_step``, ``occ_from_step``, ``occ_to_stl``, …).
|
|
20
|
+
plugins
|
|
21
|
+
COMPAS plugin registrations for the OCC backend.
|
|
22
|
+
"""
|