Commit Graph

16 Commits (40ed1b7ac13a00fb9d6381dffb4016f4ef6f12fe)

Author SHA1 Message Date
Jonathan Westhues 40ed1b7ac1 Generate intersection curves for surfaces of extrusion along a
parallel axis (which are always lines parallel to that axis).

Remove short pwl segments when possible, to avoid short edges that
get misclassified.

[git-p4: depot-paths = "//depot/solvespace/": change = 1952]
2009-05-17 23:26:51 -08:00
Jonathan Westhues 7f3dd91bd9 Add a special case for line-cylinder intersection, solving in
closed form. This is a fairly good speedup, and handles tangency
well.

But that shows that tangency has other problems; need to classify
edges correctly (whether they point to a coincident surface) in
curved surfaces too. I need to tweak SShell::ClassifyPoint().

[git-p4: depot-paths = "//depot/solvespace/": change = 1933]
2009-03-19 09:40:11 -08:00
Jonathan Westhues acadc0a918 Many changes:
* Rewrite surface handles in curves, so that Booleans beyond
      the first don't screw up.

    * If an intersection curve is identical to an existing curve
      (as happens when faces are coincident), take the piecewise
      linearization of the existing curve; this stops us from
      screwing up when different shells are pwl'd at different
      chord tols.

    * Hook up the plane faces again.

    * Remove coincident (parallel or anti-parallel) edges from the
      coincident-face edge lists when doing Booleans; those may
      happen if two faces are coincident with ours.

    * Miscellaneous bugfixes.

It doesn't seem to screw up very much now, although tangent edges
(and insufficient pwl resolution) may still cause problems.

[git-p4: depot-paths = "//depot/solvespace/": change = 1929]
2009-03-15 15:04:45 -08:00
Jonathan Westhues adc910185c Add plane-plane intersection as a special case (to generate the
trimmed line), and plane-line intersection. Terminate the Bezier
surface subdivision on a chord tolerance, and that seems okay now.
And print info about the graphics adapter in the text window, could
be useful.

Also have a cylinder-detection routine that works; should special
case those surfaces in closed form since they are common, but not
doing it yet.

[git-p4: depot-paths = "//depot/solvespace/": change = 1928]
2009-03-14 12:01:20 -08:00
Jonathan Westhues bc70089dd0 Add code to subdivide (with de Castljau's algorithm) a surface, and
use that for surface-line intersections. That has major problems
with the heuristic on when to stop and do Newton polishing.

There's also an issue with all the Newton stuff when surfaces join
tangent.

And update the wishlist to reflect current needs.

[git-p4: depot-paths = "//depot/solvespace/": change = 1925]
2009-03-08 02:59:57 -08:00
Jonathan Westhues 2023667311 Add Newton iterations to intersect a line with a surface at a
point, and to intersect three surfaces at a point. So now when we
split an edge, we can refine the split point to lie exactly on the
trim curve, so I can do certain Booleans on curved surfaces.

But surface-line intersection is globally broken, since I don't
correctly detect the number of intersections or provide a good
first guess. I maybe should test by bounding boxes and subdivision.

[git-p4: depot-paths = "//depot/solvespace/": change = 1920]
2009-02-27 05:04:36 -08:00
Jonathan Westhues 3da1e1d390 Compute surface intersections in a way that is closer to what I
will do for real; now handling the special cases of plane against a
surface of extrusion. Still need to fix up line-surface
intersection to work for curved things, but then some simple curved
cases should work (as well as plane-plane).

[git-p4: depot-paths = "//depot/solvespace/": change = 1919]
2009-02-23 02:06:02 -08:00
Jonathan Westhues 9ade574d36 Fix triangulation issues when a polygon has more than two edges at
a vertex.

[git-p4: depot-paths = "//depot/solvespace/": change = 1916]
2009-02-18 03:15:33 -08:00
Jonathan Westhues 577cdf2255 More coincident fixing; test for edge-on-edge, fix some gross
stupidity.

[git-p4: depot-paths = "//depot/solvespace/": change = 1915]
2009-02-17 03:17:12 -08:00
Jonathan Westhues c6b429b9ce Additional poking at Booleans. At least this is a halfway rational
way to think about the cases; I'm classifying the regions to the
left and right of each edge, and keeping the edges if those regions
(2d, surfaces) classify different.

Still screws up with edge-on-edge intersections; but if I make the
surface intersection stuff handle that, then might be more
straightforward to use that info.

[git-p4: depot-paths = "//depot/solvespace/": change = 1914]
2009-02-16 04:05:08 -08:00
Jonathan Westhues 90842131ff Make Boolean union work when the shells have coincident plane
faces. Still on planes only, no curved surface intersections.

[git-p4: depot-paths = "//depot/solvespace/": change = 1912]
2009-02-09 04:40:48 -08:00
Jonathan Westhues d0ab8270d9 Fix stupidity in Point2d::DistanceToLine, and classify line
segments in Boolean against the shell, not the intersection
polygon. (We just cast a ray, and use the surface-line intersection
function that already existed.) That's slow, but can be
accelerated later.

[git-p4: depot-paths = "//depot/solvespace/": change = 1911]
2009-02-01 05:01:28 -08:00
Jonathan Westhues 9ffe95ea65 More work on Booleans. This works only for planes, and only for
non-coincident faces. There's also a problem when I don't generate
the full intersection polygon of shell B against a given surface in
shell A; I need to modify the code to not require that.

[git-p4: depot-paths = "//depot/solvespace/": change = 1910]
2009-01-31 21:13:43 -08:00
Jonathan Westhues a754018a44 More poking at Booleans; generate the unsplit intersection curves
for planes against planes.

[git-p4: depot-paths = "//depot/solvespace/": change = 1907]
2009-01-26 23:59:58 -08:00
Jonathan Westhues 07ddd62a3a Preparatory work for Boolean. Make the u and v coordinates of the
trim curves for all surfaces lie between 0 and 1. And add routines
to merge the curves and surfaces from two shells into one, and to
split the trim curves into their piecewise linear segments and then
reassemble them into trim curves.

[git-p4: depot-paths = "//depot/solvespace/": change = 1905]
2009-01-25 03:52:29 -08:00
Jonathan Westhues bb4b767e99 Tear everything apart, moving away from meshes and toward shells.
Add stubs for functions to perform Booleans, and get rid of mesh
stuff, including the kd tree accelerated snap to vertex (which
should not be required if the shell triangulation performs as it
should).

Also check that a sketch is not self-intersecting before extruding
it or whatever. This is dead slow, needs n*log(n) implementation.

[git-p4: depot-paths = "//depot/solvespace/": change = 1902]
2009-01-22 19:30:30 -08:00