-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Redefine relationship between Sketch
and Face
#1691
Comments
Would this mean adding a new type, which contains a impl Sweep for Handle<Sketch> { |
A new type is probably overkill. This is possible: impl Sweep for (Handle<Sketch>, &Surface) { Other |
Before it was in shell. This partially addresses hannobraun#1689, holding off on validating sketches until we figure out sketch-face relationship: hannobraun#1691
Before it was in shell. This partially addresses hannobraun#1689, holding off on validating sketches until we figure out sketch-face relationship: hannobraun#1691
I was thinking that maybe we could introduce another object type, |
Yeah, that sounds workable! It is similar to solution 3 from the original issue description, using The advantage of adding a new type would be less redundant code. The disadvantage would be, that we'd have another object type (which adds additional code in quite a few places). Which would be better, depends on how we eventually end up using I really can't say what would be better. But I'd happily merge either solution. We can always adapt, as the use cases become more clear.
I think "region" is pretty decent. Some alternative ideas:
After thinking about it for a bit, I like "region" best, out of those three. (But again, I'd merge whatever. Renaming things is easy enough.) |
I've been working on this and got it pretty much working aside from a little issue: |
Thank you for looking into this, @A-Walrus! I don't know what the answer is right now. What I can say, is that
It would be a hack, but I think it would be fine as an initial solution. That would give us some breathing room while we figure out something better. |
Shapes in the Fornjot kernel are made up of objects (faces, edges, vertices, ...). Those objects reference each other, and the resulting object graph defines the shapes. This object graph has been simplified a lot recently (#1589), to reduce redundancy and represent shapes in a way that is as correct-by-design as possible.
The topic of this issue is one object relationship that isn't satisfactory yet, the relationship between
Sketch
andFace
.Sketch
is a top-level object, meaning it isn't itself referenced and more-or-less represents a whole shape.Sketch
references an arbitrary number ofFace
s which make up theSketch
.Face
is also referenced byShell
, which itself is referenced bySolid
, another top-level object.Face
works well in its role within the object graph ofSolid
/Shell
. Each face is defined by the surface it's on (which could be different for anyFace
in theShell
), its exterior cycle, possibly interior cycles, and a color. But the same representation does not work well within aSketch
. TheFace
s of aSketch
being in different surfaces would be wrong, and actually, the surface doesn't need to be defined at all within the context of a sketch.I've come up with the following possible solutions to this problem:
Face
s in aSketch
are defined in the same surface. This would be problematic for the following reasons:Sketch
doesn't need to be defined in a surface at all, and in fact I think it would be cleaner if it weren't. We only need a surface once we somehow apply this sketch to a 3D model (by sweeping it, for example).Face
's fields, except forsurface
, toSketch
, and referenceSketch
fromFace
. This solution has problem too:Face
needs exactly one exterior cycle, while a sketch could be made up of any number of cycles that are nested in arbitrary ways.Face
andSketch
doesn't meet the requirements we are going to face. At some point, we'll need the capability to draw a sketch, then apply it to a face, to extrude it for example. Applying a sketch to a face in this way would would be different from referencing the sketch from the face. This mismatch would at the very least be very awkward.Face
fromSketch
, and instead referenceCycle
s there directly. How exactly those cycles are referenced, all in a single collection, for example, or using some structure that reflects their nesting, is an open question. In principle, I don't think you need much structure for the cycles within aSketch
, but how you do it influences how to later apply this sketch (or convert it) to a face.I currently favor option 3., as it seems to have the fewest drawbacks. The details of the implementation would have to be figured out, however.
The text was updated successfully, but these errors were encountered: