| Filename | drawchop.pl |
| Author | Marvin Simkin |
| Program Created | 2003-04-03 |
| Last Updated | Jan 5 08:40 |
| Purpose | chop drawings into segments |
| syntax 1 | drawchop.pl [x=at[+freq]] [y=at[+freq]] [z=at[+freq]] < big.draw > chopped.draw |
| x= | flag to indicate x data follows |
| y= | flag to indicate y data follows |
| z= | flag to indicate z data follows |
| at | put first slicing plane at x (or y or z) |
| + | flag to indicate the presence of a freq option |
| freq | starting from "at", repeat slicing plane every +- "freq" |
| big.draw | drawing instructions with long lines or large objects |
| chopped.draw | drawing instructions cut up into smaller pieces |
| example |
drawchop.pl x=10 z=5+2 < big.draw > chopped.draw big.draw will be chopped into two parts: the first part is x<=10, second is x>=10 also, z chopping planes will occur at z=...,-3,-1,1,3,5,7,9,11,13... all of these parts will be output; nothing is discarded this is mostly for breaking straight lines into curves, see below for more info |
| syntax 2 | drawchop.pl -R[<xmin>][/[<xmax>][/[<ymin>][/[<ymax>][/[<zmin>][/[<zmax>]]]]]] < big.draw > small.draw |
| -R | flag to indicate minmax data follows |
| xmin | cut geometry at this X and discard anything less than this X |
| / |
separates mins and maxes, OK to leave some minmax values null if you want to keep everything in that direction (no limit) |
| xmax | cut geometry at this X and discard anything greater than this X |
| ymin | cut geometry at this Y and discard anything less than this Y |
| ymax | cut geometry at this Y and discard anything greater than this Y |
| zmin | cut geometry at this Z and discard anything less than this Z |
| zmax | cut geometry at this Z and discard anything greater than this Z |
| big.draw | drawing instructions with long lines or large objects |
| small.draw | drawing instructions with portions sliced away and discarded |
| example |
drawchop.pl -R//-100/100 keep all points regardless of their location in X (xmin and xmax are null) discard all points where Y is less than -100 or more than +100, cutting objects where they cross these boundaries a point's location in Z does not matter because zmin and zmax are unspecified The following are equivalent (and meaningless) -R -R/ -R///// For the -R option to have any effect, at least one cutting plane must be given. |
This program does two main tasks, not necessarily at the same time. (1) Chop a geometry into little bits, like a chef dicing an onion with a sharp knife. None of the input data is discarded, it is only sliced up into pieces. This is intended to process the input for drawball.pl Suppose you have a line going from 10 degrees to 30 degrees. It is going to plot as a straight line, even after drawball.pl. You need to chop it up into, say, 5 degree segments so it can bend a little now and then. (2) Cut away part of a geometry from the rest, like slicing bread off a loaf. This DOES discard the portion outside your region of interest. As currently written you should use the x, y and/or z arguments to implement task (1), and use the -R argument for task (2), but you shouldn't try to do both at the same time. (You might get away with it if your cutting planes for task (1) and task (2) do not conflict with one another, but I haven't tested this.) Currently the cutting planes must be parallel with the x, y or z coordinate planes. When making a cutting decision, a text, box, or sphere object is considered to have only one point. In other words, this does not cut words or letters in half, nor does it let you get a quarter of a sphere.
|
|
|