Repository navigation
Draft API for assembly blocks - #1362
adamchalmers wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1362 +/- ##
=======================================
Coverage ? 36.15%
=======================================
Files ? 32
Lines ? 1737
Branches ? 0
=======================================
Hits ? 628
Misses ? 1109
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| pub struct MateFrameCreate { | ||
| /// What to create the mate frame on. | ||
| pub on: MateFrameOn, | ||
| } |
There was a problem hiding this comment.
We could add options here to reorient the mate frame, e.g. translating it, rotating it, flipping the major/minor axes. WDYT David?
| pub struct MateFrameCreate { | ||
| /// What to create the mate frame on. | ||
| pub on: MateFrameOn, | ||
| } |
| /// Makes two entities occupy the same line/plane or places a point on a surface. | ||
| Coincident { | ||
| /// IDs of two mate frames in the assembly. | ||
| targets: [Uuid; 2], | ||
| }, | ||
| /// Aligns cylindrical, conical, or spherical surfaces to a common center. | ||
| Concentric { | ||
| /// Which edge? | ||
| /// IDs of two mate frames in the assembly. | ||
| /// Must be >= 2 items. | ||
| #[schemars(range(min = 2))] | ||
| targets: Vec<Uuid>, | ||
| }, |
There was a problem hiding this comment.
I think we'll need to revise the constraint catalogue if we're using mate-based constraints. Concentric, for example, sounds like it'd be ~equivalent to a cylindrical joint (i.e. two bodies share a common axis that they're free to move along/rotate around). Here's the joint catalogue I have on the solver side so far (comments are common alternative names):
struct Joint
{
enum struct Type : u8
{
Undefined = 0,
Spherical, // Ball
Distance,
Revolute, // Hinge
Cylindrical,
Weld, // Fixed, Fastened
Prismatic, // Slider
Universal, // Hooke
Planar,
PointOnPlane,
_Count,
};
// ...
};This mostly overlaps with the OnShape catalogue with the exception of their Tangent mate which doesn't make use of mate connectors. Would suggest we ignore that one for now though as it'd involve solving the general contact problem between a pair of solids which is a ways off on the geometry kernel side.
There was a problem hiding this comment.
Great, I don't think we have plans for tangent constraints yet, so that's OK. What's the difference between a joint and an assembly-level constraint on two frames? Is "joint" defined as "a constraining relationship between mate frames", like "these two mate frames have a distance of 5m" or "these two mate frames have a cylindrical joint"
There was a problem hiding this comment.
Yep that's right, "joint" is just the library-internal name given to constraints that act between a pair of bodies. They'll likely have a 1:1 reln with what we're calling "mates" at the API/engine level so we can treat them as synonymous here. I'll try to stick to "mate" when discussing unless there's a meaningful difference.
Yep, was thinking the same. Still mulling this over a bit but seems to make sense for each assembly to have its own transform, defining a local space in which the solve happens. In this case, it'd be the transform of each child in the local space of its parent assembly that gets sent back to KCL. The key benefit here is that it'd let us use nested assemblies to break large problems down into smaller ones that can be solved concurrently e.g. solving for transforms of parent assembly A can be done independently of solving for transforms of child assemblies B and C. This separation relies on expressing the transforms of each child in the space of its parent. What I'm still unsure about though is whether this transform hierarchy is something we want to persist or if it makes more sense as a transient thing that's constructed before the solve and then torn down/flattened out afterwards. Might be good to get @benjamaan476's thoughts on this as he's more familiar with how transform hierarchies currently work in engine. |
davreev
left a comment
There was a problem hiding this comment.
Looks good on the whole. I'm still a little hazy on how transform hierarchies will shake out on the engine side but no harm getting this in place now (assuming it's not set in stone).
87e9431 to
530744a
Compare
2367c59 to
55125d7
Compare
a4b5edb to
772329e
Compare
Assembly block MVP needs 3 things:
One nice-to-have that I've called out in a TODO: