Commit Graph

238 Commits (7cf3a062745762ecf9ada1823b5e6d1da13e9725)

Author SHA1 Message Date
Jonathan Westhues 7cf3a06274 A very rough set of routines to triangulate by ear clipping. This
is O(n^2), not perfectly robust, and the bridge-finding code is
particularly bad. But it works, triangulates, and shouldn't ever
generate zero-area triangles like gl does.

[git-p4: depot-paths = "//depot/solvespace/": change = 1900]
2009-01-20 21:04:38 -08:00
Jonathan Westhues ebca6130ec Early attempts at rational polynomial surfaces. I can create one
from an extrusion, with piecewise linear trim curves for everything
(that are shared, so that they appear only once for the two
surfaces that each trims). No Boolean operations on them, and the
triangulation is bad, because gl seems to merge collinear edges.

So before going further, I seem to need my own triangulation code.
I have not had great luck in the past, but I can't live without it
now.

[git-p4: depot-paths = "//depot/solvespace/": change = 1899]
2009-01-19 02:37:10 -08:00
Jonathan Westhues 25ed4e1ef1 SPolyCurve (i.e., polynomial curve) vs. SPolygon got too confusing;
let's call those Beziers instead.

[git-p4: depot-paths = "//depot/solvespace/": change = 1898]
2009-01-18 19:51:00 -08:00
Jonathan Westhues 0e623c90c0 Generate the group's polygon from the exact curves, not from edges;
so now we've got the exact curve loops, with their direction
standardized so that we can tell which direction is out. We still
need the polygon in any case, since that's a convenient way to find
each curve's winding number.

And remove some more leftover code from mesh sweeps.

[git-p4: depot-paths = "//depot/solvespace/": change = 1897]
2009-01-18 19:33:15 -08:00
Jonathan Westhues 7a874c20c0 Remove old sweep/helical sweep code for meshes, and add some
untested stuff to start making exact surface shells.

[git-p4: depot-paths = "//depot/solvespace/": change = 1896]
2009-01-16 21:28:49 -08:00
Jonathan Westhues f904c0fbee Entities now generate rational polynomial curves instead of
piecwise linear segments. These are piecewise linear approximated
for display, and currently for the mesh too, but that's the first
step to replace the mesh with exact curved surfaces.

[git-p4: depot-paths = "//depot/solvespace/": change = 1895]
2009-01-14 19:55:42 -08:00
Jonathan Westhues b8da4ed2b3 Split export DXF command into export section and export view, and
add framework for additional vector output formats (ps, pdf).

[git-p4: depot-paths = "//depot/solvespace/": change = 1893]
2009-01-13 21:10:42 -08:00
Jonathan Westhues ef11978d2c Add menu item to center view at a point; and move non-ID list data
structure from polygon.h into dsc.h, since it is used outside the
polygon/mesh code.

[git-p4: depot-paths = "//depot/solvespace/": change = 1892]
2009-01-12 22:56:05 -08:00
Jonathan Westhues 995e9397a8 Tolerate files with \r characters in them; we would never write
such a file, but mailers might mangle them.

[git-p4: depot-paths = "//depot/solvespace/": change = 1891]
2009-01-10 00:18:54 -08:00
Jonathan Westhues 984956cbc7 Add a constraint to make line length equal arc length. That's quite
tricky; can't just use the dot product, since that blows up when
you cross pi radians. A gear shift approach, use either sin or cos,
same kind of thing as the 3d-parallel constraint.

And report a NaN constraint as unconverged, of course.

[git-p4: depot-paths = "//depot/solvespace/": change = 1890]
2009-01-08 09:22:59 -08:00
Jonathan Westhues f9eedb4db7 Oops, Windows timers are periodic. So after displaying a tooltip,
we repainted once every second thereafter...

[git-p4: depot-paths = "//depot/solvespace/": change = 1889]
2009-01-04 04:52:11 -08:00
Jonathan Westhues 37795d24ba Don't let the user create workplanes locked in another workplane;
that is almost surely a mistake.

[git-p4: depot-paths = "//depot/solvespace/": change = 1888]
2009-01-04 04:39:55 -08:00
Jonathan Westhues 8d656bc600 Add feature to find the degrees of freedom; strike the
corresponding to each param from the Jacobian, and see if it loses
rank. If it does then that one was important, so it's bound. Then
display a big blue square around its point until the next normal
solve.

[git-p4: depot-paths = "//depot/solvespace/": change = 1887]
2009-01-04 04:01:46 -08:00
Jonathan Westhues 441b2a36e9 Add toolbar buttons for a few more things.
[git-p4: depot-paths = "//depot/solvespace/": change = 1886]
2009-01-03 05:30:12 -08:00
Jonathan Westhues bf4de993cb Split constraint.cpp into two files: one for building the
constraint structures based on user input, and one for generating
equations from the constraints.

[git-p4: depot-paths = "//depot/solvespace/": change = 1885]
2009-01-03 04:31:19 -08:00
Jonathan Westhues 0a56a63417 Add a trim command. I can now do circles (or arcs) against lines,
or lines against lines. The constraints get rather screwed up
afterwards, of course.

So make arcs with the endpoints coincident into circles, instead
of nothings; since the first split of a circle produces that.

And don't warn after deleting just point-coincident or horiz/vert
constraints as a dependency; that's just a nuisance, because it
happens too often.

[git-p4: depot-paths = "//depot/solvespace/": change = 1884]
2009-01-03 04:27:33 -08:00
Jonathan Westhues 0f228fc0fb Add a toolbar. This requires a tool to convert my PNG icons to
tables in the code, which I have written in perl and am checking
in.

Also get WM_MOUSELEAVE events from win32, so that I can de-hover
everything when the mouse leaves the graphics window. And fix one
of the icons, which was 23x24 instead of 24x24.

[git-p4: depot-paths = "//depot/solvespace/": change = 1883]
2009-01-02 02:38:36 -08:00
Jonathan Westhues 3ae0ca8c19 Add menu items to snap view to nearest orthogonal or iso view.
[git-p4: depot-paths = "//depot/solvespace/": change = 1882]
2009-01-01 20:06:47 -08:00
Jonathan Westhues 92f4c71d78 Check in toolbar icons for SolveSpace, no toolbar yet implemented.
[git-p4: depot-paths = "//depot/solvespace/": change = 1880]
2008-12-20 01:33:54 -08:00
Jonathan Westhues 23a4ce3697 Auto-show the text window when stepping a dimension, in addition to
auto-showing when a solve fails. And accept expressions, not just
numbers, for that new dimension value.

[git-p4: depot-paths = "//depot/solvespace/": change = 1877]
2008-09-17 02:13:37 -08:00
Jonathan Westhues 69cf8d6484 Change fudging when I select edges to generate a section from the
shell. That seems less prone generating stray lines, though it does
sometimes generate gaps.

[git-p4: depot-paths = "//depot/solvespace/": change = 1876]
2008-09-08 21:19:54 -08:00
Jonathan Westhues 816a1ee8b4 Auto-remove point-on-line constraints when at-midpoint constraints
are added. There was already precedent for that, since I
auto-remove horiz/vert constraints when symmetry constraints are
added.

[git-p4: depot-paths = "//depot/solvespace/": change = 1875]
2008-09-06 13:36:31 -08:00
Jonathan Westhues 92f55dd195 Speed up the inconsistent constraint detection; there's no reason
not to solve by substitution before rank testing. And report the
unsatisfied constraints when we don't converge.

[git-p4: depot-paths = "//depot/solvespace/": change = 1874]
2008-09-05 03:25:53 -08:00
Jonathan Westhues 33654c7ce7 Fix the mystery bug where the display disappears. That would happen
when I get a mouse moved event with the middle button down before I
got a middle button down event; orig.proj{Right,Up} were invalid.

[git-p4: depot-paths = "//depot/solvespace/": change = 1873]
2008-08-23 17:32:25 -08:00
Jonathan Westhues 51ca96b821 Hide the sweep and helical sweep for now. Exact surfaces feel
more and more necessary, and that complicates those.

[git-p4: depot-paths = "//depot/solvespace/": change = 1872]
2008-08-21 20:24:51 -08:00
Jonathan Westhues 25aa1826ee Change wording for not licensed message.
[git-p4: depot-paths = "//depot/solvespace/": change = 1871]
2008-08-21 01:47:03 -08:00
Jonathan Westhues fb33edcade Comment out the error when I generate a leaky mesh.
[git-p4: depot-paths = "//depot/solvespace/": change = 1870]
2008-08-15 00:37:32 -08:00
Jonathan Westhues fe77e7cf7e Don't enable GL_POLYGON_SMOOTH. That looks awful on my other
laptop, for some graphics card reason.

[git-p4: depot-paths = "//depot/solvespace/": change = 1869]
2008-08-14 23:37:19 -08:00
Jonathan Westhues 4bfa48fd9f Change default chord tolerance to 1, not 2.
[git-p4: depot-paths = "//depot/solvespace/": change = 1868]
2008-08-14 21:08:02 -08:00
Jonathan Westhues 285f990ad6 Make the mousewheel work in whichever window the mouser is over,
and not whichever is the foreground window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1867]
2008-08-14 20:55:03 -08:00
Jonathan Westhues 962cb1af4a Add cutter radius compensation. That's a bolt on thing at the end;
just applies an offset to the DXF before exporting. Useful enough
to be worth the ugliness, though.

This is the stupid routines from SketchFlat, slightly reworked.

[git-p4: depot-paths = "//depot/solvespace/": change = 1866]
2008-08-14 00:28:25 -08:00
Jonathan Westhues 32372aee7a Update reference manual for SolveSpace.
[git-p4: depot-paths = "//depot/solvespace/": change = 1865]
2008-08-11 03:57:46 -08:00
Jonathan Westhues 96f5663d6e Add a configuration option to hide the back faces; that gets rid of
stray red pixels sometimes, if the mesh is leaky or the graphics
card isn't perfect.

[git-p4: depot-paths = "//depot/solvespace/": change = 1864]
2008-08-11 02:56:08 -08:00
Jonathan Westhues 2a420e8400 Infer the correct supplementary angle from the sketch. Equal angle
applies to whichever is closer to original position, and angle
constraint, if the two vectors are lines that share an endpoint,
applies to vectors out from that shared point.

[git-p4: depot-paths = "//depot/solvespace/": change = 1863]
2008-02-26 04:48:31 -08:00
Jonathan Westhues 9119393108 Add some descriptions of the tutorials to SolveSpace's reference
manual.

[git-p4: depot-paths = "//depot/solvespace/": change = 1862]
2008-02-24 02:36:32 -08:00
Jonathan Westhues bd0e97bad0 Now I can suppress an imported part; so the entities still show up,
but the mesh doesn't get combined. That effectively hides it, good
for looking inside and such.

[git-p4: depot-paths = "//depot/solvespace/": change = 1860]
2008-02-15 03:35:15 -08:00
Jonathan Westhues 1c66dca5ba Assemble polygons from imported groups too; so that lets you draw a
section, import it, and extrude it.

[git-p4: depot-paths = "//depot/solvespace/": change = 1859]
2008-02-13 08:15:33 -08:00
Jonathan Westhues dae5cdf9b8 Change name to SolveSpace everywhere.
[git-p4: depot-paths = "//depot/solvespace/": change = 1858]
2008-02-13 08:13:08 -08:00
Jonathan Westhues c42033d123 Add a configuration item to specify the maximum number of piecewise
linear segments to generate, irrespective of the chord tolerance.
That used to be hard-coded, and it needs to be small enough to
avoid lags while working interactively, but I also need to export
fine geometry.

[git-p4: depot-paths = "//depot/solvespace/": change = 1857]
2008-02-12 05:00:26 -08:00
Jonathan Westhues ea7ffd4b2a Scroll the textwindow when the mousewheel moves.
[git-p4: depot-paths = "//depot/solvespace/": change = 1856]
2008-02-10 06:06:54 -08:00
Jonathan Westhues ddf2b30b98 Remove some of the oops() calls that tend to blow because of issues
in the numerical code.

And clean some other stuff, in particular simplifying whenever I
have to take the maximum (or minimum) of three quantities.

[git-p4: depot-paths = "//depot/solvespace/": change = 1855]
2008-02-10 05:34:32 -08:00
Jonathan Westhues 22b78e4427 Assemble the group polygon ourselves when exporting a DXF; that
lets us export open curves, if the user drew them that way.

Also increase the limits on how many pwls we will generate for a
single curve.

[git-p4: depot-paths = "//depot/solvespace/": change = 1854]
2008-02-10 04:43:48 -08:00
Jonathan Westhues 0c10efdab6 Add a simple license key: I take the CRC of the license info, plus
some magic numbers. This would be trivial to break, but still more
difficult than patching the binary to skip the check...

[git-p4: depot-paths = "//depot/solvespace/": change = 1853]
2008-02-09 05:52:01 -08:00
Jonathan Westhues 5a2803617b Previous speedup for regenerating vertex-to-vertex mesh was broken;
it did nothing when GenerateAll got called with an explicit range
(vs. with no args, to run on the dirty groups), so the emphasized
edges ended up out of date. I think this is better.

Also check in latest updates to manual.

[git-p4: depot-paths = "//depot/solvespace/": change = 1852]
2008-02-07 09:44:27 -08:00
Jonathan Westhues a58680201f Oops, didn't clear the hover when auto-deleting horiz/vert
constraints when adding symmetric constraints. So that could blow
up and trigger an oops.

[git-p4: depot-paths = "//depot/solvespace/": change = 1851]
2008-02-07 09:17:09 -08:00
Jonathan Westhues 04141aa59d Go back to randomizing the faces before adding to the BSP, rather
than sorting by area. I had hoped that would help with normal
accuracy, but I don't think it helped much, and it sometimes became
very slow.

[git-p4: depot-paths = "//depot/solvespace/": change = 1850]
2008-02-07 01:57:59 -08:00
Jonathan Westhues 7b7d2f92e9 Add code to evaluate the volume of a mesh, thanks to the divergence
theorem; it's evaluated as a surface integral over each triangle.

And don't regenerate the emphasized edges unless we have to;
specifically, don't do it when the only dirty group is the
drawing group.

[git-p4: depot-paths = "//depot/solvespace/": change = 1849]
2008-02-07 01:53:52 -08:00
Jonathan Westhues 115dbce61b Oops, wasn't closing the PNG file after exporting to it.
[git-p4: depot-paths = "//depot/solvespace/": change = 1848]
2008-07-20 17:34:09 -08:00
Jonathan Westhues 304c8f8be9 Add equal-angle constraints. These are implemented by brute force,
as the difference between the cosines of the two angles. All of the
angle stuff generates huge expressions (Expr *), but doesn't seem
noticeably slow.

[git-p4: depot-paths = "//depot/solvespace/": change = 1847]
2008-07-20 04:24:43 -08:00
Jonathan Westhues 8fe910da4d Add feature to trace a point; so I can show the path that a
linkage traces out, and export the coordinates.

[git-p4: depot-paths = "//depot/solvespace/": change = 1846]
2008-07-20 03:27:22 -08:00