Make the data types of element representations opaque to the assembly
module #90
Labels
No labels
bug
design
duplicate
enhancement
maintenance
prospective
question
regression
stub
todo
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: StudioInfinity/dyna3#90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We'd like to keep engine-specific code within the
engine
module as much as possible. Up through pull request #87, we've allowed engine-specific details to leak into theassembly
module by assuming that each element is represented by aDVector<f64>
. Upcoming elements, like lines, will violate this assumption, so now is a good time to redesign theassembly
module so that it no longer needs to know which data types we use to represent elements.A question to keep in mind
When an element has a "compound representation," how do we decide whether that detail is engine-independent enough to use outside the
engine
module? To see how the decision might depend on how things are implemented, consider the following ways of representing a line segment:\mathbb{R}^{4,1}
(much more engine-specific).Proposed redesign
In the
engine
moduleIntroduce a new
ElementRepresentation
trait, and newSphereRepresentation
andPointRepresentation
structures that implement it. In the future, we might also want to implementElementRepresentation
for compound representation types, like[PointRepresentation]
.In the
assembly
moduleChange the
Element
trait in one of these ways:ElementRepresentation
.representation
method to something likeSignal<dyn ElementRepresentation>
.Change the type of the
representation
field to:Signal<SphereRepresentation>
in theSphere
structure.Signal<PointRepresentation>
in thePoint
structure.If we can implement
ElementRepresentation
for compound representation types, as expected, we could also eventually have a field type likeSignal<[PointRepresentation; 3]>
for a hypotheticalTriangle
structure. This would make it clear that we don't have perfect redundancy between element and representation structures.Move the engine-specific parts of the
ProblemPoser
implementations into theengine
module. Some ideas about how:ProblemPoser
for bothSphere
andSphereRepresentation
, lettingSphere
partially or fully forwards calls topose
. Treat other element and representation structures similarly.engine::ElementRepresentation
a subtrait ofProblemPoser
and callpose
on whatever an element'srepresentation
method returns.