1CLIP(1gv)                                                            CLIP(1gv)
2
3
4

NAME

6       clip - Clip an OOGL object against planes or other surfaces
7

SYNOPSIS

9       clip [-v axisx,y,z,...]
10           [-g value-or-point] [-l value-or-point]
11           [-s nstrips[,fraction]] [-e]
12           [-sph centerx,y,z,...] [-cyl centerx,y,z,...]
13           [ooglfile]
14

DESCRIPTION

16       Clip, adapted from Daeron Meyer's ginsu module, allows clipping an OOGL
17       object against planes, spheres, or  cylinders  from  the  UNIX  command
18       line.   Its  input  can  come  from a file or standard input; output is
19       written to standard output.
20
21       Options specify a function of space position; the output is the portion
22       of  the  object  where  the function is greater or less than some given
23       value, or the portion lying  between  two  values.   Alternatively,  an
24       object can be sliced into equally-spaced strips.  Objects may be of any
25       dimension (but see the BUGS section).
26
27       Options are:
28
29       -g value-or-point
30
31       -l value-or-point
32              Select the portion of the object where the function  is  greater
33              than (-g) or less than (-l) the given value.  If both are speci‐
34              fied, the result is the portion of the  object  satisfying  both
35              conditions.
36
37              If,  rather  than a single number, the argument to -l or -g is a
38              point (a series of x,y,z,... values separated by commas, with no
39              embedded  blanks),  then  the  clipping surface is one chosen to
40              pass through that point.
41
42       -v axisx,y,z,...
43              Specifies a  direction  in  space.   For  planar  clipping  (the
44              default), it's the plane normal direction; the clipping function
45              is the inner product between the direction vector and the  point
46              on  the  object.   For  cylindrical  clipping,  -v specifies the
47              direction of the cylinder's axis; the clipping function  is  the
48              distance from the axis.
49
50       -sph centerx,y,z,...
51              Clip  against spheres centered on x,y,z,....  The clipping func‐
52              tion is the distance from the given center.  Coordinates must be
53              separated by commas without intervening spaces.
54
55       -cyl centerx,y,z,...
56              Clip  against  cylinders  with  an  axis  passing  through  cen‐
57              terx,y,z,..., with axis direction given by the -v  option.   The
58              clipping function is the distance from the axis.
59
60       -s nslices[,fraction]
61              Clip  an  object  into  a series of nslices ribbons spanning its
62              entire extent -- the range of function-values over  the  object.
63              Part  of  each ribbon is omitted; the fraction, default .5, sets
64              the width of the visible part of a ribbon compared to the ribbon
65              period.   There are a total of (nslices+fraction-1) ribbon peri‐
66              ods across the object, so e.g. -s 2,.5 slices  the  object  into
67              equal thirds, omitting the middle third.  The output OOGL object
68              is a LIST of OFFs, one per ribbon.
69
70       -e     Don't emit a clipped OOGL object, just print two numbers,  list‐
71              ing  the minimum and maximum function values for the object.  If
72              -g or -l clipping options are specified, the object  is  clipped
73              before  determining  the  function range.  If none of the object
74              remains, clip prints "0 0".
75

EXAMPLES

77       To extract the portion of an object lying below the x+y+z=1 plane:
78
79         clip -l 1  -v 1,1,1  file.oogl  > portion.oogl
80
81       To extract the portion of an object lying in the  positive  octant  and
82       below  the  x+y+z=1  plane,  we  can  pipe  multiple  instances of clip
83       together to find the intersection of several half-spaces:
84
85         clip -g 0  -v 1,0,0 file.oogl | \
86            clip -g 0 -v 0,1,0 | \
87            clip -g 0 -v 0,0,1 | \
88            clip -l 1 -v 1,1,1 > portion.oogl
89
90       To find the region lying between two surfaces  (either  above  one  and
91       below  the  other,  or  below  the first and above the second), say the
92       planes 2x + y -.5z = 1 and y + 2z = 0:
93
94            echo "{ LIST"
95            clip -v 2,1,-.5 -g 1  file.oogl | clip -v 0,1,2 -l 0
96            clip -v 2,1,-.5 -l 1  file.oogl | clip -v 0,1,2 -g 0
97            echo "}"
98
99       We use pipelines to compute intersections, and a  LIST  to  form  their
100       union.
101

SEE ALSO

103       ginsu(1)
104

BUGS

106       Uses  anytooff(1)  to convert input data to OFF format internally; this
107       can lose information.  The only arbitrary-dimensional form accepted  at
108       present  is  nOFF,  not  nSKEL  or nMESH.  However the four-dimensional
109       4OFF, 4QUAD, 4MESH, 4VECT, etc. formats should work.
110
111       Clip really only clips edges.  If a curved  clipping  surface  cuts  an
112       edge  twice,  or removes only an interior portion of some polygon, clip
113       misses it  entirely.   Clipping  against  a  curved  surface  yields  a
114       straight  edge (a chord of the ideal curved edge segment).  This latter
115       failing might be fixed someday.
116
117
118
119Geometry Center                23 November 1994                      CLIP(1gv)
Impressum