TurboCAD Forums

Turbo Talk => Problems => Topic started by: tamhas on March 23, 2014, 09:02:47 AM

Title: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 23, 2014, 09:02:47 AM
In the garden I am currently modeling based on a satellite photo, there are a number of irregular paths.  I can trace these using bezier (seems to crash a lot) or spline curves and then add straight lines at the intersection with main paths and use join polyline to turn it into a single shape.  Some of these have irregularly shaped planting beds within the overall outer shape.  I can trace those with a bezier or spline curve as well, but I can't seem to use 2D subtract to remove the inner from the outer.  I have been forced instead to use circles and "nibble" away to get something like the desired shape.   Is this expected or is it likely that I simply didn't have a well formed inner object?

I will say that I had a lot of difficulty drawing these ... not the least of which was the frequent crashes when I was trying to use bezier curves ... but I would end up often with something that looked like a complete outline, but which wouldn't fill with a hatch, due to some tiny mismatch in ends which was hard to find.

In retrospect, I suppose I could have done a rude cutout and then used the edit tool to shape it better, but that didn't occur to me until just now.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 23, 2014, 09:06:21 AM
Oh, forgot to mention that this is TC Pro 15
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: John R on March 23, 2014, 10:17:32 AM
I think you might find it easier to leave your Bezier & Line tracings as-is, then select them with the Selection tool and use "Format / Create Hatch (http://www3.turbocadcommunity.com/tiki-index.php?page=Hatching)". The bezier/line endpoints don't need to meet exactly, from what I see. The program will trace the objects with a polyline containing a hatch pattern. You can establish the pattern ahead of time by right-clicking on the Hatch icon and going to the Brush page.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 23, 2014, 11:11:29 AM
Would that help any with the "holes".  Mostly, the only big problem I had with joining was the irregular blue shapes at the top of this quadrant.  Using bezier, not only did TC crash multiple times whipping out my work, but also the curve would just stop before I was completely around the shape.  Between the two, I was trying it in pieces as best I could and having problems getting the ends to meet.  When I switched to spline, all of that nonsense quit and I finished in no time.   In this case, the center is pretty close to a circle, so it was easy to cut out, but in other quadrants it is much less regular.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: John R on March 23, 2014, 11:43:29 AM
Experiment — Draw 2 splines, one inside the other.
Leave the outer spline open (use Finish).
Use "Close" to complete the inner spline.
Select both.
Format / Create Hatch.

You end up with something as seen below; one with a spline, the other with various basic shapes.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 23, 2014, 12:04:53 PM
Very interesting.  So, this is a visual that is not really an object ... or does it turn it into a combined object?   I am curious in part because I used to work primarily in 3D, sometimes starting in 2D and then extruding the shape into the third dimension.  I suppose this project is likely to stay 2D, but I am still curious about the implications.

To clarify, I am not sure exactly what you mean by "Leave the outer spline open (use Finish)."
For me, the walkways in each quadrant tend to terminate on the main paths, so those places are straight lines.  So, I draw the spline for each of the sides and then join the ends with straight lines and use join polyline to make the whole into a single entity.   Does "use finish" imply something easier?

For the inside, there are no straight lines, just one curve and so I draw most of it and then click to close it.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 23, 2014, 12:27:12 PM
So, I tried this out drawing the outside shape as I had been and tracing an inside curve, like I had done before that wasn't working for subtraction, and then tried your Format/Hatch and the results are fabulous.

Do I understand that this works even without the join polyline?  If so, that could be a big plus because it would leave the spline curves in much more editable form.   Do I draw the straight ends or will it just close the visual gap?
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: Henry Hubich on March 23, 2014, 04:15:29 PM
So, I tried this out drawing the outside shape as I had been and tracing an inside curve, like I had done before that wasn't working for subtraction, and then tried your Format/Hatch and the results are fabulous.

Do I understand that this works even without the join polyline?  If so, that could be a big plus because it would leave the spline curves in much more editable form.   Do I draw the straight ends or will it just close the visual gap?

Yup. And yup.

Henry H
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: John R on March 23, 2014, 08:26:40 PM
I was just trying to demonstrate that it wasn't absolutely necessary to have the open end closed in some fashion (straight line) when using the "Create Hatch" tool. Whereas when using the PickPoint Hatch tool, it is.

Also, if you have "Associative Hatch" turned on in "Options / Display", you can use the Edit Tool to move the nodes one of the curves and the hatch pattern will follow it.
Title: Re: Subtracting 2D Bezier or spline shapes
Post by: tamhas on March 24, 2014, 09:13:13 AM
Thanks a bunch.   Makes life much simpler, particularly for edits (of which I am sure there will be plenty, since how accurate can it be taken from a satellite photo!)  But, they are already way ahead of where they have ever been.