Skip to main content

Render polygons, polylines, and mesh cross sections to SVG

Project description

hobart

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 lace-style polygonal meshes.

Installation

pip install numpy hobart

Usage

python -m hobart.cli horizontal-xs \
    --reference vitra_with_xs.dae \
    examples/vitra/vitra_without_materials.obj \
    15 30 45 60
import numpy as np
import vg
from lace.mesh import Mesh
from polliwog import Plane
from hobart import render_longest_xsection_to_svg

mesh = Mesh(filename="mesh.obj")

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 lace.mesh import Mesh
from polliwog import Plane
from hobart import render_longest_xsection_to_svg

mesh = Mesh(filename="examples/vitra/vitra_without_materials.obj")
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")

mesh.add_lines([xs])
mesh.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.

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-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

hobart-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file hobart-0.2.0.tar.gz.

File metadata

  • Download URL: hobart-0.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.16

File hashes

Hashes for hobart-0.2.0.tar.gz
Algorithm Hash digest
SHA256 546c53106f6d633384ad79c60bff3b18f9814700cf7bd7af538fc1a719b97294
MD5 a6dac41747163f3202f855119b3a25dc
BLAKE2b-256 cfaf73298cb3e30c4f03c08386dc3e483dc2831416b9903e87e4783ea6a45987

See more details on using hashes here.

File details

Details for the file hobart-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hobart-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.16

File hashes

Hashes for hobart-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1661f08472c6870c8f3ea53365b81d50ac7fed3f5f5c20d371f90648d23f4e49
MD5 73156c06ec3978f409a729fcd1bcd9f0
BLAKE2b-256 96547b6090bbbf61828294103b67774968cabbdf0f5d141f137067ca7cdfcb77

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page