Skip to content

Instantly share code, notes, and snippets.

@nmandery
Created November 22, 2019 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmandery/0ea5c9bc35abdaf9bde664b50b1dac77 to your computer and use it in GitHub Desktop.
Save nmandery/0ea5c9bc35abdaf9bde664b50b1dac77 to your computer and use it in GitHub Desktop.
solidpython playground
import geojson
from euclid3 import Point3
from solid.utils import extrude_along_path
from solid import scad_render_to_file
def main():
# https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/master/1_deutschland/4_niedrig.geojson
#fs = geojson.loads(open('4_niedrig.geojson').read())
#outline_d = fs[0]["geometry"]["coordinates"][0][0]
outline_d = [
[
13.7109375,
7.013667927566642
],
[
5.2734375,
3.5134210456400448
],
[
-0.3515625,
12.897489183755892
],
[
8.7890625,
15.961329081596647
],
[
27.421875,
15.284185114076433
],
[
39.0234375,
29.84064389983441
],
[
19.335937499999996,
27.994401411046148
],
[
-9.84375,
31.052933985705163
],
[
-25.3125,
14.26438308756265
],
[
-8.7890625,
-4.915832801313164
],
[
19.335937499999996,
-26.74561038219901
],
[
49.92187499999999,
-16.299051014581817
],
[
52.3828125,
1.7575368113083254
],
[
13.7109375,
7.013667927566642
]
]
#outline_d.reverse()
points = [Point3(c[0], c[1], 0) for c in outline_d]
path = [Point3(0,0,0), Point3(0,0, 1)]
ex = extrude_along_path(shape_pts=points, path_pts=path)
scad_render_to_file(ex, filepath="/tmp/t.scad", include_orig_code=True)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment