Render polygons, polylines, and mesh cross sections to SVG
Project description
hobart-svg
Render polygons, polylines, and mesh cross sections to SVG.
Features
- Render 2D and 3D polygons and polylines to SVG, with automatic computation of the bounding rectangle.
- Render cross sections of lacecore-style polygonal meshes.
Installation
pip install hobart-svg
Usage
python -m hobart_svg.cli horizontal-xs \
--reference vitra_with_xs.dae \
examples/vitra/vitra_without_materials.obj \
15 30 45 60
from hobart_svg import render_longest_xsection_to_svg
import lacecore
import numpy as np
from polliwog import Plane
import vg
mesh = lacecore.load_obj(filename="mesh.obj", triangulate=True)
plane = Plane(
point_on_plane=np.array([0.0, 30.0, 0.0]),
unit_normal=vg.basis.y)
render_longest_xsection_to_svg(
mesh=mesh,
plane=plane,
filename="cross_section.svg")
from hobart_svg import render_longest_xsection_to_svg
import lacecore
from polliwog import Plane
from tri_again import Scene
mesh = lacecore.load_obj(
filename="examples/vitra/vitra_without_materials.obj",
triangulate=True
)
plane = Plane(
point_on_plane=np.array([-0.869231, 60.8882, -20.1071]),
unit_normal=vg.normalize(np.array([0., 0.1, -1.])))
xs = render_longest_xsection_to_svg(
mesh=mesh,
plane=plane,
filename="vitra_cross_section.svg")
Scene().add_meshes(mesh).add_lines(xs).write("vitra_with_cross_section.dae")
Contribute
- Issue Tracker: https://github.com/lace/hobart-svg/issues
- Source Code: https://github.com/lace/hobart-svg
Pull requests welcome!
Support
If you are having issues, please let us know.
License
The project is licensed under the two-clause BSD license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hobart-svg-0.4.0.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for hobart_svg-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b7e20a7094d1214a900ee8b5aa67ada1e7ccab9e17a026dd0ace9891958c88 |
|
MD5 | 4825bf54361c1f6bb6211d51414a2f6c |
|
BLAKE2b-256 | 08a0a3168ce8cced2f2f1221251069bdb51f58ebb45f25c437602899e4fb5197 |