more starting work on the selectable faces, and fiddling in an
attempt to remove dependencies when stuff gets deleted.
[git-p4: depot-paths = "//depot/solvespace/": change = 1760]
csg ops; so the union of a red part and a blue part has both red
and blue faces. And some user interface to pick the color in the
text window.
The metadata also include a face, which will be an entity; I can
use that to constrain against. But none of that is yet implemented.
[git-p4: depot-paths = "//depot/solvespace/": change = 1757]
part, including all of its entities and the triangle mesh. These
are transformed by a rotation and translation, and appear in the
sketch; the transformation may be set with constraints.
[git-p4: depot-paths = "//depot/solvespace/": change = 1756]
nicely. And to do that, I've added the user interface to show an
edit control in the text window.
[git-p4: depot-paths = "//depot/solvespace/": change = 1749]
so e.g. a new extrude starts in free space, which is likely what
you want. And default to an in-workplane group, and tweak the
display of workplanes.
[git-p4: depot-paths = "//depot/solvespace/": change = 1748]
and in the case of a singular Jacobian, report which constraints
can be removed to fix it. Also a mechanism to hover and select
entities and constraints from the text window.
[git-p4: depot-paths = "//depot/solvespace/": change = 1746]
implement that. Also make solver work only between the first and
last visible group; earlier can just work from previous solve
result, and later don't matter.
There's some issues with the csg code; it will eventually produce
an open mesh, which is very bad. Not sure whether that's a logic
bug, or a numerical issue; still generating absurd triangles pretty
routinely.
[git-p4: depot-paths = "//depot/solvespace/": change = 1741]
not very well; I'm doing a b-rep, where the boundaries are complex
polygons, and there's too many special cases. I should probably
replace this with a triangle mesh solution.
[git-p4: depot-paths = "//depot/solvespace/": change = 1731]
that's in a group that solves after the current group. This means
that the constraint/request gets deleted instantly, and stuff like
auto-constraints on the just-created entities blow up. I now check
that the active workplane comes from the active group or one solved
before it.
[git-p4: depot-paths = "//depot/solvespace/": change = 1729]
as a constraint on the direction cosine, rather than driving the
dot product against a rotated vector to zero. The drawing is the
ugly part; to do that for skew lines, I gave up.
Also add a function to clear non-existent items on the selection
after solving, since that could have caused an oops().
[git-p4: depot-paths = "//depot/solvespace/": change = 1727]
the coordinate system (x, y, z normal vectors) in the bottom left
corner of the screen at all times, and hide group-created
workplanes except when that group is active, and activate that
workplane when the group is activated.
[git-p4: depot-paths = "//depot/solvespace/": change = 1726]
use the horizontal or vertical axes of the active workplane. The
equations that we write from these are very fast (of the form u + v
= 0, or u - v = 0).
[git-p4: depot-paths = "//depot/solvespace/": change = 1720]
we need something to force the points into plane, and the workplane
supplies that), but otherwise straightforward. And add diameter and
equal radius constraints for the arc.
[git-p4: depot-paths = "//depot/solvespace/": change = 1718]
list, and then adding a new entity to that list, and then looking
at that pointer again. Not okay; the add operation might have
forced a realloc. I have to watch for that.
And add a "distance ratio" constraint, plus a new kind of group
that comes with its own workplane. The workplane is not solved for;
it's generated explicitly in terms of elements that are already
solved.
[git-p4: depot-paths = "//depot/solvespace/": change = 1716]
translation; or equivalently, rotation about an arbitrary axis).
Those will be important for step and repeats, and for imported
parts.
Also fix a terrible memory corruption bug: I was freeing the remap
list after I loaded it from the file, but the code that put that
into the SS.group list made only a shallow copy.
[git-p4: depot-paths = "//depot/solvespace/": change = 1715]
constraints. And generate the constraint equations for entities
(e.g., that our unit quaternions have magnitude one). Numerical
troubles there, but it sort of works. Also some stuff to draw
projection lines with projected constraints, and to auto-insert
more constraints as you draw.
[git-p4: depot-paths = "//depot/solvespace/": change = 1711]
remap when I copy circle entities, in order to make the radius
numerical somehow (analogy with the POINT_ and NORMAL_XFRMD) thing.
[git-p4: depot-paths = "//depot/solvespace/": change = 1710]
segments), add the toggle construction command, and color the lines
differently depending on what group you're in.
Also change dynamic memory stuff to use a Win32 heap for everything
(no malloc), and validate that often. I think I've seen it crash,
though I can't reproduce it.
[git-p4: depot-paths = "//depot/solvespace/": change = 1708]
hadn't previously noticed, because I didn't use to have workplanes
with non-zero offsets. And clean up the interface to normals a bit.
[git-p4: depot-paths = "//depot/solvespace/": change = 1707]
workplanes. And fix up our polygon normals, so that everything gets
shaded correctly (and so that later we can generate our STL files
with correct normals).
[git-p4: depot-paths = "//depot/solvespace/": change = 1706]
vectors", represented by unit quaternions. This permits me to add
circles, where the normal defines the plane of the circle.
Still many things painful. The interface for editing normals is not
so intuitive, and it's not yet clear how I would e.g. export a
circle entity and recreate it properly, since that entity has a
param not associated with a normal or point.
And the transformed points/normals do not yet support rotations.
That will be necessary soon.
[git-p4: depot-paths = "//depot/solvespace/": change = 1705]
faces of the polyhedron. And shade the faces when I draw them, and
fix up our projection matrix so that the depth testing works
properly.
[git-p4: depot-paths = "//depot/solvespace/": change = 1703]
the point that's being dragged first, to guarantee that that one
gets the max possible degrees of freedom. The sort code (sort a
list of integers, then apply the permutations by swaps) was more
painful than it should have been.
[git-p4: depot-paths = "//depot/solvespace/": change = 1700]
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]
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]
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]
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]