openskp 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.
- openskp/__init__.py +47 -0
- openskp/_core.py +682 -0
- openskp/export/__init__.py +19 -0
- openskp/export/glb.py +60 -0
- openskp/export/json_export.py +124 -0
- openskp/export/obj.py +79 -0
- openskp/geometry.py +383 -0
- openskp/materials.py +190 -0
- openskp/metadata.py +214 -0
- openskp/model.py +339 -0
- openskp/parser.py +154 -0
- openskp/transforms.py +134 -0
- openskp/triangulator.py +150 -0
- openskp/vff.py +151 -0
- openskp-0.1.0.dist-info/METADATA +110 -0
- openskp-0.1.0.dist-info/RECORD +19 -0
- openskp-0.1.0.dist-info/WHEEL +5 -0
- openskp-0.1.0.dist-info/entry_points.txt +2 -0
- openskp-0.1.0.dist-info/top_level.txt +1 -0
openskp/__init__.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""OpenSKP — Open-source SketchUp binary file parser.
|
|
2
|
+
|
|
3
|
+
This is the public entry point for the ``openskp`` package. Import
|
|
4
|
+
:class:`SkpFile` to open and parse ``.skp`` files, and :class:`SkpModel`
|
|
5
|
+
to work with the resulting data.
|
|
6
|
+
|
|
7
|
+
Example::
|
|
8
|
+
|
|
9
|
+
from openskp import SkpFile
|
|
10
|
+
|
|
11
|
+
skp = SkpFile.open("building.skp")
|
|
12
|
+
model = skp.parse()
|
|
13
|
+
|
|
14
|
+
for layer in model.layers:
|
|
15
|
+
print(layer.name)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from .model import SkpFile, SkpModel
|
|
21
|
+
|
|
22
|
+
__version__: str = "0.1.0"
|
|
23
|
+
__all__: list[str] = ["SkpFile", "SkpModel", "__version__"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def main() -> None:
|
|
27
|
+
"""CLI entry point (placeholder).
|
|
28
|
+
|
|
29
|
+
Prints version information. A richer CLI may be added in future
|
|
30
|
+
releases.
|
|
31
|
+
"""
|
|
32
|
+
import sys
|
|
33
|
+
|
|
34
|
+
print(f"openskp {__version__}")
|
|
35
|
+
if len(sys.argv) > 1:
|
|
36
|
+
filepath = sys.argv[1]
|
|
37
|
+
try:
|
|
38
|
+
skp = SkpFile.open(filepath)
|
|
39
|
+
model = skp.parse()
|
|
40
|
+
print(f"Version: {model.version}")
|
|
41
|
+
print(f"Definitions: {len(model.definitions)}")
|
|
42
|
+
print(f"Layers: {len(model.layers)}")
|
|
43
|
+
print(f"Materials: {len(model.materials)}")
|
|
44
|
+
print(f"Instances: {len(model.scene_hierarchy)}")
|
|
45
|
+
except Exception as exc:
|
|
46
|
+
print(f"Error: {exc}", file=sys.stderr)
|
|
47
|
+
sys.exit(1)
|