All Projects → prideout → Svg3d

prideout / Svg3d

Licence: mit
generate 3D wireframes as vector art

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Svg3d

Vectorlogozone
3,000+ gorgeous SVG logos, perfect for your README or credits page
Stars: ✭ 239 (-6.27%)
Mutual labels:  svg
Egal
easy drawing in jupyter
Stars: ✭ 251 (-1.57%)
Mutual labels:  svg
Three.js
JavaScript 3D Library.
Stars: ✭ 78,237 (+30581.18%)
Mutual labels:  svg
Python Barcode
㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
Stars: ✭ 241 (-5.49%)
Mutual labels:  svg
Laue
🖖📈 Modern charts for Vue 2.0
Stars: ✭ 245 (-3.92%)
Mutual labels:  svg
Pathanimator
Moves a DOM element along an SVG path (or do whatever along a path...)
Stars: ✭ 251 (-1.57%)
Mutual labels:  svg
Victor
Ruby SVG Image Builder
Stars: ✭ 237 (-7.06%)
Mutual labels:  svg
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (+1061.96%)
Mutual labels:  svg
Darklaf
Darklaf - A themeable swing Look and Feel based on Darcula-Laf
Stars: ✭ 249 (-2.35%)
Mutual labels:  svg
Rough
Create graphics with a hand-drawn, sketchy, appearance
Stars: ✭ 16,472 (+6359.61%)
Mutual labels:  svg
Term Sheets
Create animated terminal presentations. Export as SVG, animated GIF, or HTML+CSS
Stars: ✭ 243 (-4.71%)
Mutual labels:  svg
Lunasvg
A standalone c++ library to create, animate, manipulate and render SVG files.
Stars: ✭ 243 (-4.71%)
Mutual labels:  svg
Swift Utils
A collection of handy swift utils
Stars: ✭ 253 (-0.78%)
Mutual labels:  svg
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (-7.06%)
Mutual labels:  svg
Php Svg
Vector graphics (SVG) library for PHP
Stars: ✭ 256 (+0.39%)
Mutual labels:  svg
Mapshaper
Tools for editing Shapefile, GeoJSON, TopoJSON and CSV files
Stars: ✭ 2,813 (+1003.14%)
Mutual labels:  svg
Svg Filters
🔮 Fildrop. A set of custom SVG Filters
Stars: ✭ 251 (-1.57%)
Mutual labels:  svg
Scratchblocks
Make pictures of Scratch blocks from text.
Stars: ✭ 257 (+0.78%)
Mutual labels:  svg
Vtracer
Raster to Vector Graphics Converter
Stars: ✭ 257 (+0.78%)
Mutual labels:  svg
Spinners React
Lightweight SVG/CSS spinners for React
Stars: ✭ 254 (-0.39%)
Mutual labels:  svg

This is a single-file Python library for generating 3D wireframes in SVG format.

For a description of how the library was designed and implemented, check out this blog post.

Usage example

import numpy, svg3d, pyrr, math

def get_octahedron_faces():
    f = math.sqrt(2.0) / 2.0
    verts = numpy.float32([ ( 0, -1,  0), (-f,  0,  f), ( f,  0,  f), ( f,  0, -f), (-f,  0, -f), ( 0,  1,  0) ])
    triangles = numpy.int32([ (0, 2, 1), (0, 3, 2), (0, 4, 3), (0, 1, 4), (5, 1, 2), (5, 2, 3), (5, 3, 4), (5, 4, 1) ])
    return 15.0 * verts[triangles]

def generate_svg(filename):
    view = pyrr.matrix44.create_look_at(eye=[50, 40, 120], target=[0, 0, 0], up=[0, 1, 0])
    projection = pyrr.matrix44.create_perspective_projection(fovy=15, aspect=1, near=10, far=200)
    camera = svg3d.Camera(view, projection)

    style = dict(
        fill="white", fill_opacity="0.75",
        stroke="black", stroke_linejoin="round", stroke_width="0.005")

    mesh = svg3d.Mesh(get_octahedron_faces(), style=style)
    view = svg3d.View(camera, svg3d.Scene([mesh]))
    svg3d.Engine([view]).render(filename)

generate_svg("octahedron.svg")

The above code snippet generates an image like this:

Running the test script

pipenv shell
pipenv install
cd extras
./test.py && open gallery.html
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].