Introducing the drawing API #29
Replies: 5 comments 17 replies
-
Nice to see iteration on the 2D aspects. I always thought that 2D is a really important primitive for code cad and thought it's lacking in most of the alternatives. Keep it up. |
Beta Was this translation helpful? Give feedback.
-
The idea of this concept to draw is very helpful, especially for persons that are used to rotate, scale, translate parts of their 2D drawing and to combine shapes. It could support a more ad-hoc way of defining the drawing compared to figuring out the position of each point in advance. I have some hesitation towards the need for a plane to place the 2D drawing into the 3D space. If there is a plane that can be deduced from an existing part this is totally fine. But if you want to place a number of cross sections into space to create a loft, for example to create a shape like an aircraft fuselage I would think that it is a faster approach to choose a drawing plane (as in the current approach for the Sketch) and allow a translate/rotate/scale for the 2D shape directly. You could then for example take a cross section, scale it and move it to the next "station line". source: https://ftforumx2.s3.amazonaws.com/2020/10/328260_1c4a5e63c68d39c95eae195a539e917d.jpg Creating a plane for each station and then placing a sketch will probably result in more code. |
Beta Was this translation helpful? Give feedback.
-
I added some explanation for the drawing API to the Quick Reference. I noticed that for a drawing it is sufficient to call the function
I can imagine that the second approach is more logical for programmers as it indicates that you can apply methods to this object. |
Beta Was this translation helpful? Give feedback.
-
I've been using the new API and ran into a small inconsistency: I understand that in simpler use cases two separate values are fewer characters to type, but in my experience these shortcuts always start causing problems at a later stage, as a codebase grows. Middle ground would be detecting argument type at runtime, but that can sometimes mask bugs in the user's code. |
Beta Was this translation helpful? Give feedback.
-
Yes, I want to make it behave like in 2D - this is a leftover from my first pass. Note that there is some work with the mirror API as well (as it mixes plane and point mirrors) and is configured differently in 2D and 3D.
There is some of these functions (but the original API was not deeply thought out). With the sketching/drawing APIs my aim has been to do what UIs do, let user think about the structure of the model and not not geometry (math) behind it. I have a conviction that math notations and conventions are awful to learn. Every term and notation is overloaded. After the heavy math during my degree in physics, learning to code and the culture of making APIs that are easy to understand instead of beautiful to prove was a breath of fresh air.
There is two now, so it feels like I might need to add support for translation vector (even if I will consider it a bad practice).
What would you think of a |
Beta Was this translation helpful? Give feedback.
-
I have been iterating a bit on issues with the sketch API, there are things that would be nice to be able to do that would be difficult to implement with sketches
As you can guess, "Drawings" and the draw solve all these issues.
For instance:
Note that the drawing API is 2D only (and lives in a 2D plane). If you want to do something in 3D, you will need to sketch your drawing, for instance in a plane:
I have implemented the "canned" or pre-baked sketches as drawings as well, so that one can do stuff more quickly.
This is an experiment - tell me if you prefer to stick with the Sketcher instead of creating a drawing!
There is a little bit of (autogenerated, so not so great) documentation on:
Beta Was this translation helpful? Give feedback.
All reactions