turned out straightforward, in great part because the planes are
workplanes (6 DOF, represented by a unit quaternion and a point),
and therefore make it easy to get a vector in the plane, as well as
a normal.
And on that subject, replace the previous hack for parallel vector
constraints with a better hack: pivot on the initial numerical
guess, to choose which components of the cross product to drive to
zero. Ugly, but I think that will be as robust as I can get.
[git-p4: depot-paths = "//depot/solvespace/": change = 1699]
or taking partials (constant folding). Also keep a little hash
table to mark with params are used in each equation, in order to
quickly discard trivial partial derivatives. This is solving a
64x64 system in <20 ms. I suspect this is now much faster than
Sketchflat.
Slightly fake situation, though, since substitution solver has not
yet been written, and no partitioning. I'll do those next.
[git-p4: depot-paths = "//depot/solvespace/": change = 1698]
not have much motivation behind them, but they seem to work. And
make sure that we don't solve multiple times without repainting in
between, and tweak the text window a bit more.
[git-p4: depot-paths = "//depot/solvespace/": change = 1696]
foreground and background colours are now specified separately, and
it's possible to insert half-line spaces. So now I have a window
that lets me show/hide groups, and select the active one.
[git-p4: depot-paths = "//depot/solvespace/": change = 1695]
assign the new ids) in the saved file, and split the file load from
table stuff into its own function.
[git-p4: depot-paths = "//depot/solvespace/": change = 1694]
erased before redraw, which caused a bit of flicker on show. And
hide debug prints in solver.
[git-p4: depot-paths = "//depot/solvespace/": change = 1693]
other entities. This requires a new point type, for a point that's
defined as a transformation of some other point. All works nicely,
I think. There's ugliness because entities are no longer guaranteed
to have a parent request.
Also speed up display of the text window, by caching brushes
instead of recreating for each character (!), and add a bit more
user interface in the text window.
[git-p4: depot-paths = "//depot/solvespace/": change = 1692]
workplane: a free constraint works in three-space (e.g. true
distance), and a constraint in a workplane works in that plane
(e.g. projected distance). And make the solver go automatically,
though solver itself has lots of pieces missing.
[git-p4: depot-paths = "//depot/solvespace/": change = 1691]
locked on to the XY plane. And simplify the handling of colors in
the text window: identify them by a character, not an integer ID,
since the character is easier to remember.
[git-p4: depot-paths = "//depot/solvespace/": change = 1687]
issues, when the points are not all in the same coordinate system.
All painful, of course. Also add continuous line drawing, and
auto-constraining of line segments as I draw.
[git-p4: depot-paths = "//depot/solvespace/": change = 1683]
determine what goes in front (e.g. put a drawn line in front of the
reference plane, even if the z order would want the opposite), and
some tweaks to the mouse behaviour, and a function to modify
constraints like dimensions so that the are initially satisfied.
[git-p4: depot-paths = "//depot/solvespace/": change = 1681]
the label associated with a constraint. And that even works,
changes the length of the line.
[git-p4: depot-paths = "//depot/solvespace/": change = 1678]
and point-in-plane. These work, but the equation is still stupid,
solving everything at once and not substituting trivial equations.
[git-p4: depot-paths = "//depot/solvespace/": change = 1677]
take the partial derivatives, and run the Newton's method. This
seems to sort of work with a single distance constraint.
[git-p4: depot-paths = "//depot/solvespace/": change = 1675]
points are now entities like any others; so a line segment request
will generate three entities, the line segment and its endpoints. I
think that's cleaner.
When I do step and repeats (and imports, and other similar), I'll
need a consistent way to assign those entity ids. That assignment
must not change if the sketch is edited. I don't have a clean way
to do that; best thought right now is to keep a record of what maps
have been used previously, and not pick a new map as long as it's
possible to use one that was used previously.
This all means that more crap gets pushed in to the Entity
structure, so that they can keep track of what solver variables
define them. Still seems better, though. I'm closer to ready
to start solving.
[git-p4: depot-paths = "//depot/solvespace/": change = 1673]
stuff, though no file load stuff, and perhaps this can all be made
to work from a table somehow. Move the quaternion stuff into its
own class, and add a fancy animated view when you orient onto a
csys.
[git-p4: depot-paths = "//depot/solvespace/": change = 1672]
expressions that we wish to keep around. And make the 2d coordinate
system (that causes points to generate 2 unknowns, not 3) an
attribute of the request, not the group, and add user interface to
change that.
[git-p4: depot-paths = "//depot/solvespace/": change = 1670]
syntax tree. That's what I'll used for entered dimensions, and
algebraic constraints and such. Needs to be extended to handle
stuff like points and entities, but I think that it can be.
[git-p4: depot-paths = "//depot/solvespace/": change = 1669]
on-screen, and I can drag the label. That's progress. Also
implement a bunch of untested expression stuff, since I'll need
that for the values of the dimensions, for example.
[git-p4: depot-paths = "//depot/solvespace/": change = 1668]
the plane basis vectors) work, easy. Tweak the text window a bit,
for cosmetics, and start to add the symbolic expression code.
[git-p4: depot-paths = "//depot/solvespace/": change = 1667]
can use the high bits as an "import ID" for imported parts, for
hierarchy (that retains parametric capabilities).
Implement enought that I can draw a datum point or a line segment,
and drag points around in three-space. Still so much to do.
[git-p4: depot-paths = "//depot/solvespace/": change = 1665]
just for display, and any text entry will happen via some floating
text box, same as entering a dimension on the sketch.
Add the hover and selection mechanism, which now seems to work.
Still not clear how to do imported parts, for assemblies and
hierarchy. The handle formats may still have to change.
[git-p4: depot-paths = "//depot/solvespace/": change = 1662]
and I am assuming that many more operations will require lookups in
the IdList<>.
Add code to represent and draw a 2d coordinate system. The origin
is described by a point, and the orientation by a quaternion. So
now it does the same thing before, and draws the reference planes,
but with a lot more lines of code.
[git-p4: depot-paths = "//depot/solvespace/": change = 1658]
progress. I want to change the sketch.h stuff fairly significantly,
I think, before proceeding.
[git-p4: depot-paths = "//depot/solvespace/": change = 1657]
draw planes that I will use to do the datum planes. Still haven't
settled upon the request/entity/group structure, and that's the
dependency before doing much real.
[git-p4: depot-paths = "//depot/solvespace/": change = 1656]
the text window every time we refresh the graphics window, because
that's slow. Use classes instead of structs for everything; I don't
understand the template handling for structs. And implement the
IdList, which I will try to use in many places.
[git-p4: depot-paths = "//depot/solvespace/": change = 1655]
and add some (non-functional) menus to the graphics window. Start
to rough in some data structures to hold the sketch. No real work
yet, though.
[git-p4: depot-paths = "//depot/solvespace/": change = 1653]
constraint solver drawing. I've started work on the user inteface,
which will be based around two windows: one with the graphical
sketch, and one command line. I've started to implement the command
line, no other work.
[git-p4: depot-paths = "//depot/solvespace/": change = 1652]