LEGO.scad icon indicating copy to clipboard operation
LEGO.scad copied to clipboard

Swept back wing

Open benoitpaillard opened this issue 5 years ago • 4 comments

Hi, thanks for the great tool.

Is it possible with your code to make swept back wings such as this : https://rebrickable.com/parts/3586/wedge-plate-7-x-12-wing-left/

thanks !

benoitpaillard avatar Apr 30 '20 10:04 benoitpaillard

OK, so I have given this some thought, and I am of a few different minds.

I've created a branch here to explore some ideas: https://github.com/john-parton/LEGO.scad/tree/feature/python

At a high level it works like this:

  1. You create an SVG path of the outline of the part you want. (Note, I made an error here.)

Screenshot from 2023-01-21 00-15-07

  1. The code converts the SVG path to a polygon, extrudes it to the proper height, carves out the interior, figures out where studs needs to go, figures out where posts need to go, figures out if any notches need to be cut out into walls and then emits the SCAD file.

Screenshot from 2023-01-21 00-16-03

john-parton avatar Jan 21 '23 06:01 john-parton

I handled some really weird cases like parts with holes.

Screenshot from 2023-01-21 00-23-46

It also means that you can just feed in simple shapes and you don't need to worry about where the studs are going to be.

Circles are trivial

Screenshot from 2023-01-21 00-25-03

Ever want a pentagonal lego?

Screenshot from 2023-01-21 00-25-31

john-parton avatar Jan 21 '23 06:01 john-parton

Screenshot from 2023-01-21 00-30-18

@cfinke Thoughts? I can try to clean this up and submit it here or I can just create a new repo for this. I think this is pretty obviously outside the realm of "easy-to-use customizer for lego blocks" and more into "gone mad with power and wants to turn the universe into lego blocks."

john-parton avatar Jan 21 '23 06:01 john-parton

This is very cool! But it probably does deserve to live in its own repo, assuming it doesn't actually rely on LEGO.scad for anything.

cfinke avatar Jan 26 '23 05:01 cfinke