-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KCL gear example #6
Comments
@Irev-Dev would love your feedback especially on open question 2. I guess we'd tag the top face of the cylinder, and then build a tooth-shaped path, and then put the path on the tagged face. |
For I think we'll draw the Considering that and a few other thoughts on the API this is making me think of, I might try my hand at some psuedo code too. 🔜™️ |
I think Agree about the angular distance param. |
Another thing to think about in the |
I wrote up the same thing in JS which uses const { circle, cm, nothing } = require("../index");
const cylinder = ({ height, radius }) => circle(radius).extrude(height);
const donut = ({ height, outerRadius, innerRadius }) =>
cylinder({ height, radius: outerRadius })
.difference(cylinder({ height, radius: innerRadius }));
const tooth2d = () => nothing(); // Define the tooth in whatever way
const tooth3d = ({ height }) => tooth2d.extrude(height);
const teeth = ({ amount, height, radius }) =>
tooth3d({ height }).distribute.radial({ amount, radius });
const gear = ({ amount, height, radius }) =>
donut({ height, outerRadius: radius, innerRadius: radius/10 })
.difference(teeth({ amount, height, radius }));
const gear1 = gear({ amount: 40, height: 3*cm, radius: 30*cm });
const gear2 = gear({ amount: 33, height: 20*cm, radius: 30*cm }); In FREP engines you can also do things like infinite extrude, so the height on the tooth3d is unnecessary. Quite honestly all I can think about improving this is having native measurement types. Objects, spread, rest, and destructuring really make manipulating variables easy-peasy. The declarative API keeps context where it matters, reducing the need to retype a lot and read naturally. |
I forgot to do selecting an axis or similar for the |
I was able to follow along with no problem. I like it. |
We're gonna need examples of how to practically use KCL. I think a gear is a good first step. It's a nontrivial 3D solid, and it's also very common in real CAD. Here's what I've got so far.
@jgomez720 says the way real engineers draw gears is:
It'll be something like this (remember, type annotations will be optional, they're included here for clarity)
Just walking through this example with Josh was really helpful for bridging the gap between my software and his hardware background.
Open questions:
circularPattern
is still hazytoothToRemove2D
on the cylinderThe text was updated successfully, but these errors were encountered: