Hey All,
I've been thinking a lot about SymbolicObj2 and SymbolicObj3, the
types for our first representation of objects in ImplicitCAD.
One thing that has occurred to me is that we might merge them together
into one GADT parametrized by a domain, d:
data SymbolicObj :: * -> * where
Union :: [SymbolicObj d] -> SymbolicObj d
Translate :: d -> SymbolicObj d -> SymbolicObj d
Implicit :: (d,d) -> (d -> ℝ) -> SymbolicObj d
And so on. However, this doesn't really allow us to describe matrix
multiplication, extrudes, and slices as we might like. If we switch to
parametrizing over the natural numbers for dimension, and use some
type families, we can accomplish this in a very elegant way:
http://hpaste.org/79473
That said, the types become more complicated. It's a bit of a trade off.
Revolve :: SymbolicObj n -> SymbolicObj (Succ n)
We also want to have a type parameter for material/color. We probably
want it to be an instance of a function to allow us to take weighed
averages between two values -- eg. average (0.2, "red") (0.8, "blue")
-- and in discrete cases just jump. Then we'll produce a
color/material function that describes the color/material at any
point. We can discuss what the exact semantics should be elsewhere.
How we should embed meta data is another question again. Perhaps a
type parameter gives the type of meta data?
1. I see a use for an object *container* which represents a "part" to me.
2. The part can be transformed as a whole (rigid body and affine transforms are most useful) and all its contained objects are transformed together.
3. The container contains a number of SymbolicObj3's (usually just one of these) and SymbolicObj2's, plus more items.
4. Metadata about the part as a whole is in the container.
5. Metadata about a contained object is embedded in that object.
6. I see great value in supporting SymbolicObj1's (lines) and SymbolicObj0's (points).
7. With the set listed above, I have the basic elements I have in my mental model as an engineer: the body of the object, its symmetry planes, the axes of its features (like bored holes), its surfaces, reference points, materials metadata, and annotations.
As an example, look at the bellcrank arm here: http://stores.homestead.com/Partsdude4x4/catalog/946965.jpg . When I think about this part I am especially interested in the centerlines of the two bored holes, the center point of the pivot ball, and the four planar faces surrounding the two holes; these are the functional elements of the geometry. I want to express these functional elements and their spatial relationships parametrically in extopenscad.
Cheers,
Chuck