Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Created December 14, 2017 20:11
Show Gist options
  • Save madhephaestus/e897dd658fa6741270e4598457cfc2bf to your computer and use it in GitHub Desktop.
Save madhephaestus/e897dd658fa6741270e4598457cfc2bf to your computer and use it in GitHub Desktop.
GearAlternate
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import eu.mihosoft.vrl.v3d.svg.*;
import eu.mihosoft.vrl.v3d.Extrude;
File f = ScriptingEngine
.fileFromGit(
"https://gist.github.com/cgstephenson/3d23388d5b5db75be3c217d79ffcda88",//git repo URL
"master",
"airFoil.svg"// File from within the Git repo
)
SVGLoad s = new SVGLoad(f.toURI())
ArrayList<CSG>gear = s.extrude(10,0.01)
return gear.collect{it.scale(10)}
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="912.37054mm"
height="487.32886mm"
viewBox="0 0 912.37054 487.32886"
version="1.1"
id="svg3723"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="GearBase.svg">
<defs
id="defs3717">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-62.498121 : 445.98688 : 1"
inkscape:vp_y="0 : 222.59695 : 0"
inkscape:vp_z="374.0553 : 445.98688 : 1"
inkscape:persp3d-origin="155.77858 : 427.90722 : 1"
id="perspective4058" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="913.70779"
inkscape:cy="837.64464"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1" />
<metadata
id="metadata3720">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(180.14457,164.02123)">
<path
sodipodi:type="star"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-opacity:1"
id="path6014"
sodipodi:sides="24"
sodipodi:cx="73.8554"
sodipodi:cy="88.206444"
sodipodi:r1="184.79224"
sodipodi:r2="230.99028"
sodipodi:arg1="0.9526521"
sodipodi:arg2="1.0835518"
inkscape:flatsided="false"
inkscape:rounded="0.22"
inkscape:randomized="0"
d="m 180.9469,238.80386 c -9.59599,6.82381 11.46108,47.99877 1.0565,53.51167 -10.40458,5.51291 -32.64789,-35.03351 -43.68304,-30.92583 -11.03514,4.10767 -1.35244,49.32959 -12.82933,51.96174 -11.4769,2.63216 -22.46811,-42.28966 -34.190382,-41.17806 -11.722274,1.1116 -14.073795,47.29869 -25.840876,46.87072 C 53.69269,318.61613 54.70262,272.38024 43.092069,270.42002 31.481518,268.4598 17.256025,312.46448 6.0006643,309.00555 -5.2546963,305.54661 7.6875475,261.14757 -3.0200403,256.24911 -13.727628,251.35065 -38.857649,290.17408 -48.834255,283.9199 c -9.976605,-6.25417 14.01596,-45.79066 4.94104,-53.29353 -9.074921,-7.50288 -43.396901,23.49354 -51.414862,14.87034 -8.017963,-8.62321 25.389873,-40.60278 18.56606,-50.19877 -6.823812,-9.59599 -47.998763,11.46108 -53.511673,1.0565 -5.5129,-10.40457 35.033509,-32.64789 30.925837,-43.68303 -4.107677,-11.03515 -49.329597,-1.35244 -51.961747,-12.82934 -2.63216,-11.47689 42.28966,-22.4681 41.17806,-34.19038 -1.1116,-11.722272 -47.29869,-14.073793 -46.87071,-25.840875 0.42797,-11.767081 46.66385,-10.757152 48.62407,-22.367702 1.96022,-11.610552 -42.04446,-25.836044 -38.58552,-37.091405 3.45893,-11.2553606 47.857973,1.686883 52.756435,-9.020705 4.898462,-10.70758777 -33.924965,-35.837609 -27.670795,-45.814214 6.25418,-9.976606 45.79066,14.01596 53.293538,4.941039 7.502879,-9.07492 -23.493548,-43.3969 -14.870343,-51.414861 8.623205,-8.017961 40.602782,25.389872 50.198768,18.56606 9.595987,-6.823813 -11.46108,-47.998767 -1.056503,-53.511667 10.404578,-5.51291 32.6478939,35.033503 43.6830373,30.925831 11.0351437,-4.107673 1.3524407,-49.329591 12.8293357,-51.961751 11.476895,-2.63215 22.468105,42.289668 34.190379,41.178067 11.722274,-1.111602 14.073795,-47.298687 25.840877,-46.870717 11.767081,0.42797 10.757151,46.663853 22.367701,48.624076 11.61055,1.960223 25.83605,-42.044456 37.09141,-38.585526 11.25536,3.45893 -1.68689,47.857977 9.0207,52.756439 10.70759,4.898462 35.83761,-33.924969 45.81422,-27.670799 9.9766,6.25418 -14.01597,45.790664 -4.94104,53.293542 9.07492,7.502878 43.3969,-23.493549 51.41486,-14.870344 8.01796,8.623205 -25.38988,40.602783 -18.56606,50.198769 6.82381,9.5959866 47.99876,-11.461081 53.51167,-1.056503 5.5129,10.4045772 -35.03351,32.647894 -30.92584,43.683037 4.10768,11.035144 49.3296,1.35244 51.96175,12.829336 2.63216,11.476895 -42.28966,22.468105 -41.17806,34.190379 1.1116,11.722274 47.29869,14.073795 46.87072,25.840876 -0.42798,11.767078 -46.66386,10.757148 -48.62408,22.367708 -1.96022,11.61055 42.04446,25.83604 38.58552,37.0914 -3.45893,11.25536 -47.85797,-1.68688 -52.75643,9.0207 -4.89847,10.70759 33.92496,35.83761 27.67079,45.81422 -6.25418,9.9766 -45.79066,-14.01596 -53.29354,-4.94104 -7.50288,9.07492 23.49355,43.3969 14.87035,51.41486 -8.62321,8.01796 -40.60279,-25.38987 -50.19877,-18.56606 z"
inkscape:transform-center-x="-0.72619509"
inkscape:transform-center-y="-21.365778" />
</g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment