colouring outside the lines
Posts
CAD musing:
factoring SDFs tends one to represent geometric primitives centred on the origin and axis-aligned, and then moved/oriented by transforming the input.
but specifying geometry by constraint necessarily means acting externally to the geometric primitives—"these two coordinates are equal" is a sensible statement only within a given frame of reference, which is modified by every transformation of the input.
for example, an axis-aligned square's length can be constrained by simple subtraction¹:
right.y - left.y ≡ length
but as soon as it's oriented, your coordinates are entangled and you are suddenly forced to introduce square roots, a tool of the ℝeals:
⎷((tr.x - tl.x)² + (tr.y - tl.y)²) = length
I'm starting to think of constraints as being introduced under a prefix. the frame of reference for a constraint contextualizes the variables it constrains, such that the square's width is constrained within its orientation and translation, but clearance between it and an enclosing shape requires its vertices to be transformed into a suitable enclosing frame of reference.
I'm more or less used to thinking of geometry this way: the frames of reference are in direct correspondence with the individual matrices in a chain of multiplications which translate screen-space coordinates to window-space to world-space and possibly beyond (e.g. we might approximate the position of the moon by defining it relative to the earth's position; or we might have the parts of a car contained within the same frame of reference, but then extend it by rotation and translation to model opening the doors or steering).
but thinking of constraints this way harmonizes particularly nicely with my PLT sympathies: frames of reference are very much like the entries in a context which bind the variables in an otherwise open term.
the consequences of this aren't immediately clear to me, but it seems that scoping constraints lexically to supply a frame of reference is pretty reasonable. e.g. a tree of components, each branch with a frame of reference and some geometry, naturally relates variable scoping with frames of reference s.t. each component might come equipped with its own internal constraints relating parts of its geometry and/or subcomponents to each other, but relating them to the broader composition must occur at least one node higher up; or, perhaps, we can form such constraints interior to a component iff we are able to transform the coordinates used by the constraint into the frame of reference local to the component.
going back to our square, it's clear that this gives us a much more straightforward way to _specify_ the constraint on the square's length, but if the square is oriented off-axis then we must surely perform the same computation… if we solve top-down. but maybe we can figure out a way to solve bottom-up, and then relate the (highly localized) substitution backwards up the stack, i.e. solve the simple subtraction and then only transform the solution, not the constraint, back out?
1: if translations are factored out too, then this is actually right.y ≡ -left.y ≡ length / 2, but you still have to have a square root to specify the length
It’s time to play Things That Sound Filthy but Actually Aren’t. I’ll start: tendril perversion https://en.wikipedia.org/wiki/Tendril_perversion
Finally completed: 12mm boring bar with 4mm HSS insert and boring bar holder for use in my lathe. I finished the boring bar first, and used it to bring the bore in the holder to dimension (20mm, to fit the ER20 collet chuck shown here). Huge thanks to Stefan Gotteswinter for his generosity in sharing so much skill and knowledge via his incredible Instagram and YouTube channel. I have learned so much from him, and in particular I pulled the boring bar design wholesale from one of his videos and learned to position slitting saws vertically accurately from another. (I still made kind of a hash of the slot, due mostly to the dullness of the saw blade and its tiny gullets getting packed with chips.) Excited to use these to finish off the bore in my shop-made precision level’s housing!