Commit Graph

32 Commits (f70bbb3e7f9443138e7b6cdff9539b2e304d436a)

Author SHA1 Message Date
Jonathan Westhues b2f2f90a27 Add DXF export. The complexity comes from all the different ways to
specify the plane from which we want to grab the triangles. Shared
edges are then removed with the same code used to check for
watertight meshes, and the remaining edges are assembled into
polygons.

[git-p4: depot-paths = "//depot/solvespace/": change = 1823]
2008-07-07 22:30:13 -08:00
Jonathan Westhues cad77c9c47 Add routines to remove T intersections from the mesh, which are
introduced by the bsp routines. It's usually, though not always,
possible to generate a watertight mesh. The occasions where it's
not look ugly, floating point issues, no quick fix.

And use those to generate a list of edges where two different faces
meet, which I can emphasize for cosmetic reasons (and some UI to
specify whether to do that, and with what color).

And make the right mouse button rotate the model, since that was
previously doing nothing.

[git-p4: depot-paths = "//depot/solvespace/": change = 1821]
2008-07-05 23:56:24 -08:00
Jonathan Westhues 8a70efed05 Make sliver triangle tests work on the minimum altitude, not on
area.

[git-p4: depot-paths = "//depot/solvespace/": change = 1816]
2008-07-01 20:32:24 -08:00
Jonathan Westhues b77cb053e2 Move `Solve Once Now' to the Edit menu, and call it `Regenerate';
and fix some other problems with the menu labels.

[git-p4: depot-paths = "//depot/solvespace/": change = 1815]
2008-06-30 01:34:03 -08:00
Jonathan Westhues a47a77c37c Back to opengl's tesselator for triangulation. I'll spend more time
writing mine later.

[git-p4: depot-paths = "//depot/solvespace/": change = 1810]
2008-06-25 23:28:29 -08:00
Jonathan Westhues 9b008ad1cd Check in a broken triangulation code (by stupid ear clipping),
which I will shortly revert. gl does a much better job, and I'll
have to spend more time to get something reasonable.

[git-p4: depot-paths = "//depot/solvespace/": change = 1809]
2008-06-25 23:25:42 -08:00
Jonathan Westhues a5189f7f1a Make step and repeats step the mesh, as well as the entities. This
requires new entitiy types for the faces, by translation or by
axis-angle rotation.

[git-p4: depot-paths = "//depot/solvespace/": change = 1802]
2008-06-21 14:49:57 -08:00
Jonathan Westhues 5a22982e05 Add sweeps. The user specifies a trajectory and a section, in two
separate groups. The section is swept normal to the trajectory,
producing a mesh. I'm doing the triangles only now, not copying
over any entities.

Also fix a bug in the PNG export; rows are 4-aligned, so that was
breaking when the width of the image wasn't divisible by four. Also
fix a bug in lathes, where it generated overlapping triangles for
one segment.

And change the groups to record both "this mesh", the contribution
due to the extrude/lathe/whatever, and the "running mesh", that we
get after applying the requested Boolean op between "this mesh" and
the previous group's "running mesh". I'll use that to make step and
repeats step the mesh too.

[git-p4: depot-paths = "//depot/solvespace/": change = 1801]
2008-06-21 02:18:20 -08:00
Jonathan Westhues b5c87291ea Fix failure to solve when auto-constraining new arc, and make all
paths absolute immediately.

[git-p4: depot-paths = "//depot/solvespace/": change = 1795]
2008-06-16 00:35:05 -08:00
Jonathan Westhues 8969687904 Bits and pieces; option to not include original in step translates
and rotates, auto-constrain translates in active workplane, speed
up remap list search with a hash table, other stuff.

[git-p4: depot-paths = "//depot/solvespace/": change = 1786]
2008-06-11 20:36:33 -08:00
Jonathan Westhues 8498a99588 Add preliminary lathe (solid of revolution) support. I'm generating
just the mesh, no derived entities (but I suppose that I could turn
all points into circles).

And fix some bugs where equations didn't get unique IDs, and make
it possible to lock on to the group's workplane automatically, if
you press W while free in 3d with no workplane selected.

[git-p4: depot-paths = "//depot/solvespace/": change = 1780]
2008-06-06 03:35:28 -08:00
Jonathan Westhues 71391e6a55 Add an interference check for assembled parts. That's easy once the
BSP stuff works. The failures are reported with red stripes and no
depth buffering, and in a message in the text window.

Also improve convergence of point-on-line constraints, and don't
write triangles to export files with limited precision, because
that was making the coplanar tests fail.

[git-p4: depot-paths = "//depot/solvespace/": change = 1774]
2008-06-03 22:39:32 -08:00
Jonathan Westhues 6748160026 Add selectable faces, by associating an hEntity with the triangle's
metadata. And add point-on-face constraints to go with that. Still
needs some cleanup for the user interface.

[git-p4: depot-paths = "//depot/solvespace/": change = 1766]
2008-06-01 19:31:37 -08:00
Jonathan Westhues f803806029 Don't initialize the SEdges with ... = { ... }; use a special
function for that.

[git-p4: depot-paths = "//depot/solvespace/": change = 1759]
2008-05-30 00:01:19 -08:00
Jonathan Westhues 69eb2273ac Add color. Now each triangle has metadata, which are preserved in
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]
2008-05-29 22:09:41 -08:00
Jonathan Westhues 010a65894d Now I can rename groups, using that same edit control in the text
window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1750]
2008-05-27 01:52:36 -08:00
Jonathan Westhues c58dbf1676 When a triangle gets split when it's added, retriangulate in an
effort to reduce the number of pieces.

[git-p4: depot-paths = "//depot/solvespace/": change = 1743]
2008-05-25 19:39:45 -08:00
Jonathan Westhues 248f74547e Add user interface to specify union/difference for extrudes, and
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]
2008-05-25 05:11:44 -08:00
Jonathan Westhues 0ad8644df4 As we break things against the BSP, keep an arbitrary convex
polygon, not just triangles. This helps to avoid needless
splitting. Also test if an entire triangle got inserted in multiple
pieces; if yes, back things out, and just insert the triangle.

Also remove the extra partition stuff, since it didn't seem to help
consistently, and this does.

Still could do some better merging, in the case where an inserted
triangle does not get fully inserted, but we can find a better
triangulation than what the BSP naturally gives.

[git-p4: depot-paths = "//depot/solvespace/": change = 1739]
2008-05-24 15:10:00 -08:00
Jonathan Westhues 70ccbebc8f Add extra split planes (not coplanar with any triangle) to the BSP
while building it. That may improve performance, by building a more
balanced tree and actually reducing splitting. Not dramatic
improvements, though; half the triangles for some parts, but no
change or slightly worse for others.

[git-p4: depot-paths = "//depot/solvespace/": change = 1737]
2008-05-24 04:23:25 -08:00
Jonathan Westhues 4d7ffc85f9 Make coplanar faces work properly, by implementing a 2d BSP on each
set of coplanar faces. The polygon count still gets stupid fast;
I'm thinking I can fix that by adding some extra test planes at the
top of the 3d BSP, to quickly cull out stuff that doesn't intersect
us.

[git-p4: depot-paths = "//depot/solvespace/": change = 1736]
2008-05-24 02:34:06 -08:00
Jonathan Westhues de46118324 Add code to extrude a triangle mesh, and to perform Boolean ops on
a triangle mesh in a BSP. That works, although it splits too often,
the initial triangulations are not good quality, and coplanar faces
are not yet handled. I'll do the coplanar thing tomorrow.

[git-p4: depot-paths = "//depot/solvespace/": change = 1735]
2008-05-23 02:05:07 -08:00
Jonathan Westhues 7c4d305895 Add polygon triangulation, by cheating. I'm using the gl tesselator
for that, and storing the triangles instead of rendering them
immediately. Not sure if that's smart; in theory could change from
implementation to implementation, but the results look much better
than I would get myself.

[git-p4: depot-paths = "//depot/solvespace/": change = 1733]
2008-05-22 02:28:28 -08:00
Jonathan Westhues e80328279e Rip out the boundary rep csg stuff. I'll redo that with a triangle
mesh approach.

[git-p4: depot-paths = "//depot/solvespace/": change = 1732]
2008-05-20 19:58:14 -08:00
Jonathan Westhues c4e1270e25 Add constructive solid geometry ops. These work to some extent, but
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]
2008-05-19 01:23:49 -08:00
Jonathan Westhues 2ec23ffa3e Fix point-on-circle constraints to work with arcs too, and lock
extrudes normal to workplane if a workplane is active when the
extrusion is created.

[git-p4: depot-paths = "//depot/solvespace/": change = 1724]
2008-05-15 22:34:06 -08:00
Jonathan Westhues 4eed7693be Little changes, more pwls in a circle, and make "same orientation"
constraints work mod 180 degrees, so that it snaps to however the
workplane was drawn (more vertical vs. more horizontal).

[git-p4: depot-paths = "//depot/solvespace/": change = 1714]
2008-05-10 18:57:47 -08:00
Jonathan Westhues d048946adc Fix some stupid bugs introduced with the new representation of
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]
2008-05-05 01:47:23 -08:00
Jonathan Westhues 30636a6f29 Make the extrude command do a bit more; now I generate all the
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]
2008-05-02 02:54:22 -08:00
Jonathan Westhues a7cec38656 Add code to assemble the piecewise linear segments in a group into
a polygon, and to fill that polygon.

[git-p4: depot-paths = "//depot/solvespace/": change = 1686]
2008-04-24 23:04:09 -08:00
Jonathan Westhues 1331457928 Rough file/save for SolveSpace; that's all done from a single
table, relatively small code size. No user interface for it,
though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1685]
2008-04-23 22:22:16 -08:00
Jonathan Westhues a8001adf33 Add horizontal and vertical constraints. Those have their own 2d/3d
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]
2008-04-22 23:29:19 -08:00