Skip to main content

hobart-svg

version license build docs build code style

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

Pull requests welcome!

Support

If you are having issues, please let us know.

License

The project is licensed under the two-clause BSD license.

Metadata

Release files for hobart-svg 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hobart-svg 0.4.1
File Size Uploaded
hobart-svg-0.4.1.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hobart-svg 0.4.1
File Interpreter ABI Platform
hobart_svg-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / hobart-svg-0.4.1.tar.gz

Download URL hobart-svg-0.4.1.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4a24ebf19358111fc2602add6689ccc9f17a42e28bf657f82ce98608cc96c3f7
BLAKE2b-256 checksum
How to use checksums
24518568f941c416ee3ecc7bdef06ab6962a68b297f434c7b9c517942c4e6a1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / hobart_svg-0.4.1-py3-none-any.whl

Download URL hobart_svg-0.4.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d071912b1cc9e58d176cf80595722890357c34064cdac7e258abfc0a56e90d29
BLAKE2b-256 checksum
How to use checksums
34bf1f0b9ebea05e428c9bc4b184d5c5b9ed50aef07058f0ae5a2093220b8b61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page