REPLICATOR SYSTEM AND METHOD FOR DIGITIZING
 THE GEOMETRY OF A PHYSICAL OBJECT
Appendix
 The attached appendix, consisting of 55 pages of source code in the CADL language, is fully incorporated herein.
Background of the Invention
Field of the Invention
 The present invention relates to computer modeling and graphics systems, and more particularly to systems for digitizing a physical model in response to input signals produced directly from detection of surface characteristics of the physical model.
Description of the Related Technology
 After a physical model is created, it may be useful to create a computer file describing the model. This file can be used, among other things, to develop animations and create tooling. Companies perform this process in a variety of ways. For simple shapes, the object can be measured and the data entered manually, i.e., by hand, via a standard computer aided design (CAD) program. This works for simple objects but becomes very difficult with curves or other complex shapes. The operator must be well trained and very accurate in the measurement and entry steps in order to achieve good results.
 In the last several years a number of three-dimensional digitizing devices have been introduced on the market that allow the object to be "traced" in space and a file created from this data. These devices include both manual digitizers, that are moved into position by the operator, and scanning laser based systems, that rotate the object on a pedestal and automatically gather the data. Both system types have their disadvantages.
 The scanning laser systems gather large amounts of data, usually at a predetermined spacing. As a result data files can become quite large and the resulting models more complex then required. This can be a tremendous burden when animating an object. These systems also have trouble with some shapes. For example, when digitizing a human model, the system may not be able to distinguish the body from the arms. As a result the arms of the model can blend into the body. The file then has to be hand modified to correct many of these problems. This is a time consuming and error prone task.
 A major problem with manual digitizers is that inputting the data is tedious and error prone. The physical model normally has a grid placed on it, either with thin tape or drawn on it . The operator, using the grid as a reference , goes to the points of interest and inputs them. Since the digitizer is much more accurate then the operator, the data is never quite smooth. Many times the model seams do not meet or other problems are created that require the resulting data files to be hand modified. The operator must be highly trained for good results with this type of device.
 Therefore, what is needed is a system to accelerate the process of digitizing a physical model for the purpose of creating a CAD file and which does this by minimizing the human intervention required. Such a system needs to provide support for a digitizer in order to speed data gathering, eliminate errors, and simplify the process so less training is necessary. Summary of the Invention
 The Replicator is a system and method used to speed up the process of digitizing a physical model for the purpose of creating a CAD file. The Replicator works with the digitizer to speed data gathering and eliminate errors.
 One aspect of the present invention includes a system for replicating the geometry of a physical object comprising: a computer; storage means interfaced with the computer for storing data representative of features of a multidimensional object; input means connected to the computer for producing input signals representative of locations in three-dimensional space; means responsive to the input means for defining a line extending between selected ones of said locations, wherein said line extends across at least a portion of space in which said object is defined, by said data, as residing; means responsive to the input means for detecting when a location represented by at least one of said input signals intersects a portion of said line; means, responsive to said means for detecting, for producing a signal identifying the location of said intersection; and means responsive to said signal for storing data in said storage means, so as to represent a corresponding location of a portion of said multidimensional object with respect to each of its dimensions.
 Another aspect of the present invention includes a method for replicating the geometry of a physical object by use of a computer having storage means for storing data representative of features of a multidimensional object, and an input device, the method comprising the steps of: producing input signals representative of locations in three-dimensional space; defining a line extending between selected ones of said locations, wherein said line extends across at least a portion of space in which said object is defined, by said data, as residing; detecting when a location represented by at least one of said input signals intersects a portion of said line; producing a signal identifying the location of said intersection; and storing data in said storage means so as to represent a location of a portion of said multidimensional object, corresponding to said intersection location, with respect to each of the dimensions of said multidimensional object.
 The system also includes an apparatus and a method wherein at least a portion of the stored data is then used to define the object. The data can be modified by conventional systems such as CAD systems to produce a modified object. Data representing the original or modified object may be used to control tools to produce physical objects corresponding to the object represented by the data.
Brief Description of the Drawings
 Figure 1 is a block diagram illustrating the components  of a presently preferred embodiment of the computerized replicator system for digitizing the geometry of a physical object of the present invention;
 Figures 2a and 2b are a top-level flow diagram of a process used by Manual, SemiAuto, and Auto Modes of the replicator system of Figure 1; and
 Figures 3a and 3b are a top-level flow diagram of a process used by Cut Plane Mode of the replicator system of Figure 1.
Detailed Description of the Preferred Embodiment
 The following detailed description of the preferred embodiments presents a description of certain specific embodiments to assist in understanding the claims. However, the present invention can be embodied in a multitude of different ways as defined and covered by the claims.
 For convenience, the following description will be outlined into the following 7 principal sections: System
Overview; Components of the Replicator System; Operating Commands & Features of the Replicator System; Manual, SemiAuto and Auto Modes; Cut Plane Mode; Data Usage; and Epilogue.
I. System Overview
 In its simplest form the Replicator system can be thought of as creating planes onto which data points are semi-automatically gathered. The operator defines a plane in the computer that slices through space occupied by the object to be digitized. The digitizing probe tip is placed on the object and moved along the object so as to pass through the plane. Each time the probe passes through the plane a point is captured. The operator does not have to know exactly where the plane is as long as the probe is passed through it (a sound cue, e.g., beep, is sounded when this occurs). The plane is then moved and the next set of points are input. The system allows for automatic plane incrementation, and the intersection of multiple planes. Multiple coordinate systems and other features such as finding the maximum point along a  coordinate axis are supported. These functions, while simple in principle, allow an experienced operator to digitize a model much more quickly and accurately than with conventional tools. These functions also allow a less-experienced operator to be useful in the process.
 The data that is gathered is then passed to a commercially available software package, such as a package produced by FastSURF, Inc., of Sonoma, CA, called FastSURF, for spline generation. The system works with a CAD system called CADKEY manufactured by CADKEY, Inc. In other embodiments, the Replicator system utilizes other PC and UNIX based computers.
 The Replicator also has data compression capabilities that may be considered to be a byproduct of the operator guided data input. An highly-experienced operator will not gather needless data points, so there will be less data to describe the object than if it were digitized by a laser scanner. However, the Replicator allows operators having lessor skill levels to minimize the amount of data collected due to the guidance provided by the system.
II. Components of the Replicator System Figure 1 illustrates the components of one presently preferred embodiment of the computerized replicator system 100 for digitizing the geometry of a physical object of the present invention. A 386 class or newer personal computer
(PC) 102 includes a plurality of components internal and external to an enclosure 104. A graphics interface 106 interconnects the computer 102 to a video display 114. The video display may also be included within enclosure 104. Connected to the computer 102 is a storage device 108, e.g., a hard disk drive of a minimum 80 Megabytes, a keyboard 110, a pointing device 112, e.g., a mouse, and an optional printer 116. These components 110-116 may be integrated within enclosure 104, such as, for example, a laptop or notebook class portable computer. Also connected to the computer 102 is a measurement arm or probe 120 that is used to probe a physical object 122.
 The Replicator system 100 (also called the 3-D Replicator) includes a software program which, when used in conjunction with CADKEY CAD software and the Metrecom Industrial-1 measurement arm 120, manufactured by Faro Technologies, Inc., enables the end user to develop 2-D (two dimensional) and 3-D (three dimensional) computer/digital geometry from the physical object 122. CADKEY is a trademark of CADKEY, Inc., and Metrecom Industrial-1 is a trademark of Faro Technologies, Inc.
 Through a series of menus and by using the Faro Metrecom Industrial-1 probe 120 the user can create points, lines, polylines, splines, arcs, circles, and polygons. Furthermore, the user can also utilize the measure option to determine the distance between two points, and by using the "Pnt Near" and "Pnt Far" functions the user can locate key points on the physical object 122. The Replicator system 100 essentially integrates CADKEY and the Faro Metrecom Industrial-1 120 together in a user-friendly way resulting in high levels of end user productivity. The Replicator system software is written in CADL, CADKEY' s Advanced Design Language. CADL is a trademark of CADKEY, Inc. CADKEY is a CAD software program which runs on 386 class and newer personal computers (PCs) using MS-DOS and also on Unix platforms. MS-DOS is a trademark of Microsoft Corporation. The Metrecom Industrial-1 is a peripheral device which attaches to the personal computer or Unix platforms. The Metrecom Industrial-1 120 essentially is a three-dimensional measurement arm or probe which sends the location of the arm's tip, in X, Y, Z coordinate terms to the personal computer 102. Of course, any commercially available input device for obtaining location information of 3-D objects can be used, including non-contact devices such as lasers, sonic devices and the like. The Faro Metrecom IND-1
 The Industrial Metrecom 120 (Figure 1) is a portable, state-of-the-art 3-D measurement arm or probe which provides a highly advantageous combination of speed, flexibility, and accuracy for a great variety of design, reverse engineering, production, and quality control applications. The Industrial Metrecom 120 scans and measures complex 3-D surfaces and all other conventional features instantly.
 The measurement arm 120 of the presently preferred embodiment is a counter-balanced, six degree-of-freedom (X, Y, Z, pitch, roll, yaw) instrumented arm, constructed of anodized aircraft aluminum with precision bearings. High precision rotary transducers at each of six joints combine to provide complete point position and body orientation information. Measurements are taken by two switches (not shown) located at the handle. A point probe and a 0.25" ball probe are included with the system. Custom probes can be used with convenient probe calibration software.
 The IND-01 model measurement arm 120 has a Sigma of 0.008 inches, for both single point positional accuracy and linear displacement accuracy. Therefore, the 2-Sigma accuracy of the IND-01 model is +/- 0.016 inches. This means that 95.5% of all the measurements will have an accuracy of +/- 0.016 inches.
CADKEY 6
 CADKEY 6 is a desktop mechanical engineering, design, and drafting software system for mechanical design engineers. Through years of focusing exclusively on mechanical design, CADKEY, Inc., has created this powerful productivity tool custom made for engineers and designers .
 CADKEY' s advanced features support the complete design-to-manufacturing process. The pioneer of desktop 3-D mechanical design, CADKEY, Inc., has revolutionized 3-D mechanical design by offering high-end CAD system capabilities at desktop prices. Thus, the Replicator provides a low cost, high-end capability system to the user.
 CADKEY offers a full spectrum of desktop tools, through in-house products and 3rd party vendors, for concurrent engineering capability companies need to streamline the design, engineering, and manufacturing processes and bring better products to market quickly.
 The Replicator was developed using CADKEY's CADL language. A seamless interface between The Replicator and
CADKEY 6 was thus provided. Once the user has captured the data of the model using the Replicator, the power of CADKEY 6 for CAD/CAM and FastSURF for surface modeling is then enabled. FastSURF 6
 More and more of today's manufactured products are designed with aesthetically pleasing shapes and profiles. But designing these shapes in a CAD system has proven to be difficult, in addition to getting the product to market in a timely manner. But now these shapes can be developed competently and quickly on a PC platform with FastSURF. FastSURF, a 3rd party CADKEY system developer, brings advanced splines, smooth surfaces, and 3-D tools to desktop engineering.
 FastSURF has application in reverse engineering, conceptualizing, prototyping and rendering. The geometry created by the user by the Replicator-FastSURF combination is transferable to most popular CAM packages via CADL, direct translator, or out via IGES surface translator.
III . Operating Commands & Features of the Replicator System
The Replicator System Menu
 A computer user accesses the menu shown below to operate the system. The options are defined as:
3D Build
 3D Build creates 3-D Point, Line, or Polyline Strings and Splines.
3D Build - Point: Creates a 3-D Point String
3D Build - Line: Creates a 3-D Line String 3D Build - Polyline - Open: Creates a 3-D Polyline String with Open End Condition
3D Build - Polyline - Closed: Creates a 3-D Polyline String with Closed End Condition
3D Build - Spline - Open: Creates a 3-D Spline with Open End Condition
3D Build - Spline - Closed: Creates a 3-D Spline with Closed End Condition 3D Build - Mode: Cycles Manual, Auto, and CutPlane modes
3D Build - SetGrid: Accesses SetGrid Menu to set Primary and Secondary Planes
3D Build - Control: Accesses Control Menu to set Beep On/Off, AutoPace, MaxNodes, SetGrid, and Pnts On/Off global controls
3D Build - 3DR Help: Accesses 3DR Help for the Replicator's 3D Build Menu
2D Draw
 2D Draw creates a 2-D Point, Line, or Polyline String and Splines.
2D Draw - Point: Creates a 2-D Point String
2D Draw - Line: Creates a 2-D Line String 2D Draw - Polyline - Open: Creates a 2-D Polyline String with Open End Condition
2D Draw - Polyline - Closed: Creates a 2-D Polyline String with Closed End Condition
2D Draw - Spline - Open: Creates a 2-D Spline with Open End Condition
2D Draw - Spline - Closed: Creates a 2-D Spline with Closed End Condition
2D Draw - Mode: Cycles Manual and Auto modes
2D Draw - SetFrame: Window sizes around the current drawing area.
2D Draw - Control: Accesses Control Menu to set Beep On/Off, AutoPace, MaxNodes, and Pnts On/Off global controls
Tools
 Tools creates Arcs, Circles, Polygons, and also creates new CADKEY System Views.
Tools - Arc: Creates an Arc by Probe selecting 3 Nodes
Tools - Circle: Creates a Circle by Probe selecting 3 Nodes
Tools - Polygon: Creates a Polygon by Probe selecting 3 to 8 Nodes
Tools - View: Creates a new CADKEY System View by Probe selecting 3 Nodes. Upon completion the newly created view appears in the upper right hand window.
Tools - Mode: Status only, Tools only supports Manual mode Tools - Control: Accesses Control Menu to set Beep On/Off and Pnts On/Off global controls
Locate
 Locate utilizes key points on an object's surface and measures the distance between two points.
Locate - Track: Sets the system to track, in real time, the X, Y and Z location of the Probe tip.
 Special Functions:
 X, Y, and Z: Coordinates displayed on CADKEY prompt line.
Finder: A White Finder appears on the screen to help the user locate key locations on an object's surface relative to Geometry already displayed on the screen. The Finder can be cycled On/Off by using Locate:Control:Fndr On/Off. Button One: By pressing Button One (B1), the user can generate a single point.  Locate - Pnt2Pnt : Measures the Distance between two Probe selected locations on an object's surface
Locate - Pnt Near: Finds a location on an object's surface which is closest to the pre-specified Primary Plane.
 Button One: Press and hold B1 while the probe is in contact with the object's surface and move the probe tip toward the appropriate location. As the user moves the probe, the system dynamically moves a point on the display in the appropriate direction. When the user is satisfied that the desired location is found on the object's surface, B2 is released.
Locate - PntFar: Finds a location on an object's surface which is farthest from the pre-specified Primary Plane.
 Button One: Press and hold B1 while the probe is in contact with the object's surface and move the probe tip toward the appropriate location. As the user moves the probe, the system dynamically moves a point on the display in the appropriate direction. When the user is satisfied that the desired location on the object's surface is found, B1 is released.
Locate - PntPln X: Finds the location on the object's surface which intersects at the intersection of the Primary and Secondary Planes.
 Button One: Press and hold B1 while the probe is in contact with the object's surface and move the probe tip toward the appropriate location. When the user has located the intersection of the Primary and Secondary
Planes, the system automatically creates a point at that location.
Locate - SetGrid: Accesses SetGrid Menu to set Primary and Secondary Planes
Mode Mode Overview: The Mode switch acts as a status indicator and a Mode selector. As a status indicator, it informs the user which mode the system is in: Manual, Auto, or CutPlane . When Building Entities with the Probe, control is passed from The Replicator Menu System to the Probe and its switches. The Mode switch controls how the Replicator collects and processes Node strings.
 Manual: Click & Release for each Node
 SemiAuto: Click, Drag & Release or Click & Release for each Node (s)
 Auto: Click, Drag & Release for each Node string
CutPlane: Click, Drag & Release for each Node
The Mode switch also controls how the Replicator interprets the buttons, i.e., Button 1 (B1) and Button 2 (B2) , pushed by the user on the Probe.
 Manual: B1 Click & Release B2
 Get Node End Node String
 SemiAuto: B1 Click & Release B2
 B1 Click & Drag End Node String
 Get Node
 Auto: B1 Click & Drag B1 Release
 Build Node String End Node String
 CutPlane: B1 Click & Drag B2
 Get Node End Node String Mode - Manual: When set in Manual Mode, the Replicator expects the user to Probe select each Node in a string on a Click. & Release basis. With the Probe in contact with the object's surface, the user presses B1. As the user is selecting each node, the system displays a temporary white point at each node location and a dashed white line connecting each node. When complete, the user presses B2 and the system clears the temporary points and dashed lines and then creates the Entity in the Current System Color and Points (if Pnts-On) in Red, B1ue, Gray, Green format. The user is then free to initiate the next Node string by pressing B1 or by pressing the Delete Key to delete the last Entity and Points (if Pnts- On) created .
 Keys Supported:
 B1 Click Sc Release: Select 1 through N Nodes in string. B2: Mark end of Node string and create Entity(s).
 Esc Key: By pressing the Esc Key the user terminates any function in progress and returns control to the Replicator Menu System.
 Delete Key: After pressing B2 to mark end of Node string and before pressing B1 to initiate another string, the user can delete the Entity (s) just created. The B2 Key is also a way to pass control from the Probe to the Replicator Menu System. If the user presses the B2 Key any time the system is not building a Node string, control is passed from the Probe to the Replicator Menu System.
Mode - SemiAuto: When set in SemiAuto Mode, the Replicator expects the user to Probe select a Node in a string on a Click
& Release or a Click and Drag basis. With the Probe in contact with the object's surface, the user presses B1. As the user is selecting each node, the system displays a temporary white point at each node location and a dashed white line connecting each node. When complete, the user presses B2 and the system clears the temporary points and dashed lines and then creates the Entity in the Current System Color and
Points (if Pnts-On) in Red, B1ue, Gray, Green format. The user is then free to initiate the next Node string by pressing B1 or by pressing the Delete Key to delete the last Entity and
Points (if Pnts-On) created.
 Keys Supported:
 B1 Click & Release and/or Click and Drag: Select 1 through N Nodes in string.
 B2: Mark end of Node string and create Entity(s) .
 Esc Key: By pressing the Esc Key the user terminates any function in progress and returns control to the
Replicator Menu System.
 Delete Key: After pressing B2 to mark end of Node string  and before pressing B1 to initiate another string, the user can delete the Entity (s) just created. The B2 Key is also a way to pass control from the Probe to the Replicator Menu System. If the user presses the B2 Key any time the system is not building a Node string, control is passed from the Probe to the Replicator Menu System.
Mode - Auto: When set in Auto Mode, the Replicator expects the user to Probe select the entire Node string on a Click,
Drag, & Release basis. With the Probe in contact with the object's surface, the user presses B1 and drags the Probe along the object's surface. As the user is selecting each node, the system displays a temporary white point at each node location and a dashed white line connecting each node. When complete, the user presses B1 and the system clears the temporary points and dashed lines and then creates the Entity in the Current System Color and Points (if Pnts-On) in Red, B1ue, Gray, Green format. The user is then free to initiate the next Node string by pressing B1 or by pressing the Delete
Key to delete the last Entity and Points (if Pnts-On) created.
Keys Supported:
 B1 Click, Drag & Release: Select 1 through N Nodes in string.
 B1 Release: Mark end of Node string and create Entity(s).
 Esc Key: By pressing the Esc Key the user terminates any function in progress and returns control to the Replicator Menu System.
 Delete Key: After pressing B1 to mark end of Node string and before pressing B1 to initiate another string, the user can delete the Entity(s) just created. The B2 Key is also a way to pass control from the Probe to the Replicator Menu System. If the user presses the B2 Key any time the system is not building a Node string, control is passed from the Probe to the Replicator Menu  System .
Mode - CutPlane: When set in CutPlane Mode, the Replicator expects the user to Probe select each Node in a string on a Click, Drag, & Release basis. With the Probe in contact with the object's surface, the user presses B1 and drags the Probe along the object's surface to locate a Node which is on the object's surface and intersects the Primary Plane. As the user is selecting each node, the system displays a temporary white point at each node location and a dashed white line connecting each node. When complete, the user presses B2 and the system clears the temporary points and dashed lines and then creates the Entity in the Current System Color and Points
(if Pnts-On) in Red, B1ue, Gray, Green format. The user is then free to initiate the next Node string by pressing B1 or by pressing the Delete Key to delete the last Entity and
Points (if Pnts-On) created.
 Keys Supported:
 B1 Click, Drag & Release: Select 1 through N Nodes in string.
 B2: Mark end of Node string and create Entity(s).
 Esc Key: By pressing the Esc Key the user terminates any function in progress and returns control to the Replicator Menu System.
 Delete Key: After pressing B2 to mark end of Node string and before pressing B1 to initiate another string, the user can delete the Entity(s) just created. The B2 Key is also a way to pass control from the Probe to the Replicator Menu System. If the user presses the B2 Key any time the system is not building a Node string, control is passed from the Probe to the Replicator Menu System.
Control
Control cycles the Mode, Beep, Points, and Finder switches, changes AutoPace and MaxNodes globals, and accesses the SetGrid Menu. Control - Mode: Cycles Manual, SemiAuto, Auto, and CutPlane modes
Control - Beep (On/Off): Cycles the confirmation Beep On/Off
Control - Points (On/Off): Cycles Points On/Off. When Points is set to Pnts-On, Points are created and color are coded Red, B1ue, Gray, and Green as follows: Point 1 - Red, Point 2 - B1ue, Points 3 through N-1 - Gray, Point N - Green. If Less than four points are Probe selected by the user, the following conditions apply:
 1 Point: Point 1 Green
 2 Points: Point 1 Red, Point 2 Green
 3 Points: Point 1 Red, Point 2 B1ue, Point 3 Green
Control - Points (Hide/Show): Hides or Shows Points created with Points On/Off above. When Points is set to Pnts-On, Points are created on the current level plus one. If the current level is One then the points created are placed on level Two. Points Hide/Show cycles the display of Level Two on/off. If the active Level (CADKEY' s ALEV) Level is changed to three (i.e., ALEV=3), subsequent points are generated on Level Four. Control - Finder: Cycles the Finder On/Off. This function is only supported by the Locate:Track and Locate:Pnt2Pnt modes.
Control - AutoPace: Sets the delay in seconds between each Node selection when operating in Auto mode. System default is 0.00 seconds.
Control - MaxNodes: Sets the maximum number of Nodes in a Node string. System default is one hundred Nodes. Control - SetGrid: Accesses SetGrid Menu to set Primary and Secondary Planes  SetGrid
 SetGrid Overview: The SetGrid enables the user to set the Primary and Secondary Planes. The Primary Plane must be selected in order to use the Replicator's CutPlane Mode. The Primary and Secondary Planes must be specified in order to use the Replicator's Locate:PntPln X (i.e., Locate the Point on an object's surface which intersects at the intersection of the Primary and Secondary Planes). The Replicator sets the Grid Planes at an X,Y and Z coordinate origin of 0,0,0. Key In Plane displacements assume this origin. The Primary Plane is always displayed in Red. The Secondary Plane is always displayed in Green.
SetGrid - Ppln: Set Primary Plane is used to cycle the Primary Plane as follows:
 Ppln XY: XY Plane, Z Displacement
 Ppln XZ: XZ Plane, Y Displacement
 Ppln YZ: YZ Plane, X Displacement
 The Replicator sets the Grid Planes at an X,Y and Z origin of 0,0,0. Key In Plane displacements assume this origin. The Primary Plane is always displayed in Red.
SetGrid - PplnDisp - Probe: Sets the Primary Plane's displacement using the Probe. Used to Probe select the
Primary Plane's displacement offset on the object's surface.
SetGrid - PplnDisp - Mouse: Sets the Primary Plane's displacement using the Mouse. When using the Mouse option the following Menu is displayed: CURSOR, POINT, ENDENT, INTRSC, ALONGL, POLAR, DELTA, and KEY-IN. CURSOR, and POINT are the most useful. CURSOR enables the user to mouse select, with the system cursor, the desired Primary Plane's displacement. POINT enables the user to utilize an existing point to specify the Primary Plane's displacement.
SetGrid - PplnDisp - Key In: Keys In the Primary Plane's  displacement.
SetGrid - Spin: Set Secondary Plane is used to cycle the Secondary Plane as follows:
 Spin XY: XY Plane, Z Displacement
 Spin XZ: XZ Plane, Y Displacement
 Spin YZ: YZ Plane, X Displacement
 The Replicator sets the Grid Planes at an X,Y and Z origin of 0,0,0. Key In Plane displacements assume this origin. The Secondary Plane is always displayed in
Green.
SetGrid - SplnDisp - Probe: Sets the Secondary Plane's displacement using the Probe. Used to Probe select the
Secondary Plane's displacement offset on the object's surface.
SetGrid - SplnDisp - Mouse: Sets the Secondary Plane's displacement using the Mouse. When using the Mouse option the following Menu is displayed: CURSOR, POINT, ENDENT, INTRSC, ALONGL, POLAR, DELTA, and KEY-IN. CURSOR, and POINT are the most useful. CURSOR enables the user to mouse select, with the system cursor, the desired Secondary Plane's displacement. POINT enables the user to utilize an existing point to specify the Secondary Plane's displacement.
SetGrid - SplnDisp - Key In: Keys In the Secondary Plane's displacement. SetGrid - Grid Tol: Sets the Primary Plane's tolerance for the Replicator's CutPlane mode, i.e., specifies the Primary Plane's tolerance. The system default for Grid Tol is +/- 0.025. Lowering Grid Tol increases the Replicator's precision and makes finding Nodes more difficult. Increasing Grid Tol decreases the Replicator's precision and make finding Nodes less difficult.  SetGrid - GridSize: Sets Primary and Secondary Plane size to a new user-specified size. The Replicator system default for GridSize is six units. If CADKEY is in Inches mode, the outer boundaries of the Primary and Secondary Planes are displayed six inches from the origin of the Plane.
SetGrid - Origin - Probe: Sets the Origin of the Primary and Secondary Grid Plane to a new user specified location using the Probe. The Replicator system default for Grid Plane Origin is 0, 0, 0.
SetGrid - Origin - Mouse: Sets the Origin of the Primary and Secondary Grid Plane to a new user specified location using the Mouse. The Replicator system default for Grid Plane Origin is 0, 0, 0. When using the Mouse option the Following Menu is displayed: CURSOR, POINT, ENDENT, INTRSC, ALONGL, POLAR, DELTA, and KEY-IN. CURSOR, and POINT are the most useful. CURSOR enables the user to mouse select, with the system cursor, the desired Grid Plane's location. POINT enables the user to utilize an existing point to specify the desired Grid Plane's location.
SetGrid - Origin - Key In: Keys In the Origin of the Primary and Secondary Grid Plane to a new user-specified location. The Replicator system default for Grid Plane Origin is 0, 0, 0.
SetGrid - GridRset: Resets the Origin of the Primary and Secondary Grid Plane to the Replicator's system defaults. The Primary and Secondary Planes are set to Null. The
yPrimary and Secondary Plane Displacements are set to zero. Grid Tol is set to 0.025. Origin is set to 0, 0, 0, and Autolnc is set to zero. IV. Manual. SemiAuto and Auto Modes
 Referring to Figures 2a and 2b, a top-level process 200, used by the Manual, SemiAuto, and Automatic Modes previously explained, will now be described. Beginning at a start state 202, the computer 102 (Figure 1) advances to state 204 to get a point node from the probe or coordinate measurement machine (CMM) 120 (Figure 1). The data of the incoming point node from the CMM 120 is in X, Y, Z coordinates format. The CMM arm is guided by the user on the surface of object 122. The point node data is saved at state 206 in an X, Y, Z node array. Each entry in the node array stores the X, Y and Z coordinates for the point node. After the data is saved at state 206, the computer 102 moves to a decision state 208 to determine if all the points have been acquired, i.e., has the user indicated to the computer that, all desired points have been acquired by pressing a button (B2) on the measuring arm or other similar user action (mouse click, keyboard keyin, and so forth) . If not, the computer 102 moves back to state 204 to get the next point from the CMM 120. However, if the point node acquisition is done, as determined at state 208, the computer 102 proceeds to a decision state 210 to determine if the user desires to build a point stream, as selected from the menu. A point stream is a collection of point nodes in 3-D space that define the boundaries of an entity. If not, the computer 102 proceeds through off-page connector A 212 to a decision state 220 on Figure 2b. However, if the result of decision state 210 is true, the computer moves to state 214 and builds a point stream based on the X, Y, Z array previously written at state 206. At the completion of state 214, i.e., the point stream is built, the computer 102 proceeds through off-page connector B 216 to end state 232 on Figure 2b.
 At decision state 220 determines if the user desires to build a line stream, as selected from the menu. A line stream is a sequential series of lines connecting the nodes collected by the CMM 120 in X, Y, Z space that are stored in the order of entry. If so, the computer 102 moves to state 222 and builds a line stream based on the X, Y, Z array previously written at state 206. At the completion of state 222, i.e., the line stream is built, the computer 102 proceeds  to the end state 232. If the user does not desire to build a line stream, as determined by state 220, the computer 102 proceeds to a decision state 224 to determine if the user desires to build a polyline, as selected from the menu. A polyline is defined by a minimum of three node points. If so, the computer 102 moves to state 226 and builds the polyline based on the X, Y, Z array previously written at state 206. At the completion of state 226, i.e., the polyline is built, the computer 102 proceeds to the end state 232. If the user does not desire to build a polyline, as determined by state 224, the computer 102 proceeds to a decision state 228 to determine if the user desires to build a spline, as selected from the menu. If so, the computer moves to state 230 and builds a spline based on the X, Y, Z array previously written at state 206. At the completion of state 230, i.e., the spline is built, the computer 102 proceeds to the end state 232. If the user does not desire to build a spline, as determined by state 228, the computer 102 proceeds to end state 232.
V. Cut Plane Mode
 Referring to Figures 3a and 3b, a top-level process 250, used by the Cut Plane Mode previously explained, will now be described. Beginning at a start state 252, the computer 102 (Figure 1) advances to state 254 to get a point node from the probe or coordinate measurement machine (CMM) 120 (Figure 1). The data of the incoming point node from the CMM 120 is in X, Y, Z coordinates format. The CMM arm is guided by the user on the surface of object 122. Moving to a decision state 256, the computer 102 determines if the incoming point node is in the cut plane previously determined by the user. If not, the computer 102 moves back to state 254 to get the next point node from the CMM as the user moves the probe along the surface of the object 122. This next point node is then checked at state 256 to determine if it is in the cut plane.
 When the criteria of state 256 is true, that is, the incoming point node is in the cut plane, the computer 102 moves to state 258 and saves the point node data in a X, Y, Z node array. The computer 102 also produces a signal, such as a beep tone, to notify the user of crossing the cut plane. After the data is saved at state 258, the computer 102 moves to a decision state 260 to determine if all the points have been acquired. If not, the computer 102 moves back to state 254 to get the next point from the CMM 120 and to perform the cut plane check at state 256. However, if the point node acquisition is done, as determined at state 208, the computer 102 proceeds through off-page connector A 262 to a decision state 264 on Figure 3b. States 264 through 280 of Figure 3b are essentially the same as states 210 through 232 of Figures 2a and 2b, and therefore, to avoid repetition, are not described.
VI. Data Usage
 The data describing the physical object 122 (Figure 1) that is measured by CMM 120 is stored in a file in the computer 102 or in storage 108. This data may then be processed to create a surface representation which can be used to create tooling, molds, and so forth for the manufacture of copies of the object. Another use of the data is for graphics or animation for producing an accurate image of the object. Thus, the object data may be used as output by the replicator system 100, or the data may be modified using industry standard CAD/CAM or modelling software to user specifications, e.g., the object is enlarged.
 The Replicator system data or the modified data is then sent to a manufacturing system common to the industry to produce exact copies of the original physical object or copies of the user-modified version of the original physical object. Alternately, the user may send the Replicator system data or the modified data to an animation system to utilize exact copies of the original physical object or copies of the user-modified version of the original physical object. There are many graphics or animation systems in use in the industry.  VII. Epilogue
 The system software described herein, a portion of which is listed in the attached appendix, is written in CADL, version 6. The software was translated from source code to machine readable object code using the CADKEY CADL language compiler.
 In yet other embodiments, other computers, operating systems, CAD packages, or algorithms can be used. The general system, method and procedures would remain the same. The Replicator system described herein finds application in many environments, and is readily adaptable for use therein.
 While the above detailed description has shown, described and pointed out the fundamental novel features of the invention as applied to various embodiments, it will be understood that various omissions and substitutions and changes in the form and details of the device illustrated may be made by those skilled in the art, without departing from the spirit of the invention.
2DDRAW.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem 2DDRAW.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem Allows picks for various manual input sequences
rem Points - Point by point
rem Lines - Line string by line string
rem Polylines - (Open/Closed) Polyline string by polyline string
rem Splines - (Open/Closed) Spline
 MenuLev=MenuLev+1
refno=0
sys_autovp 0,0
set view,2,0
auto -1
redraw -1
if (ModeNum == CutPlane)
 HodeMum=Manual
:top
getmenu "Select Geometry Type",\
 "Point", "Line", ''Polyline", "Spl ine"," - ",$$ModeX [ModeNum] ,\
 "SetFrame","Control',,"3DR Help",MenuLev,9
switch (@key)
 {
 case -3:-2
 goto exit
 break
 case 1
 GeoType=CKpoint
 dosub drawget.cdp
 break
 case 2
 GeoType=CKline
 dosub drawget.cdp
 break
 case 3
 getmenu "Select 3-D Polyline type", "Open" \
 "Ctosed",,,,,,,, (MenuLev+1},1
 switch (@key)
 {
 case -3:-2
 goto exit
 case 1
 Ptype = Open
 break
 case 2
 Ptype = Closed
 break
 case 3:9
 break
 default
 break
 }
 GeoType=CKpline
 dosub drawget.cdp
 break
 case 4
 getmenu "Select 3-D Spline type", "Open",\
 "Closed", ,,,,,,, (MenuLev+1 ), 1
 switch (@key)
 case -3:-2
 goto exit
 case 1
 Stype = Open
 break
 case 2
 Stype = Closed
 break
 case 3:9
 break
 default
 break
 }
 GeoType=CKspline
 dosub drawget.cdp
 break
 case 5
 goto top
 break
 case 6
 ModeNum=ModeNum+1
 if (ModeNum > 2)
 ModeNum=Manual
 break
 case 7
 dosub setframe.cdp
 break
 case 8
 dosub control.cdp
 break
 case 9
 Menu=3  2DDRAW.CDP Tuesday, July 27, 1993 11:29 pm Page 2 dosub 3drhelp.cdp
 sys_autovp 0,0
 set view,2,0
 break
 default
 Menu=3
 dosub 3drhelp.cdp
 sys_autovp 0,0
 set view,2,0
 break
 }
goto top
:exit
sys_autovp 7,0
MenuLev=MenuLev-1
EXIT
3DBUILD.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem 3DBUILD.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem Allows picks for various manual input sequences
rem Points - Point by point
rem Lines - Line string by line string
rem Polylines - (Open/Closed) Polyline string by polyline string
rem Splines - (Open/Closed) Spline
 MenuLev=MenuLev+1
 :top
getmenu "Select Geometry Type",\
 "Point", "Line", ''Polyline", "Spl ine"," - " ,$$ModeX[ModeNum] ,\
 "SetGrid","Control","3DR Help",MenuLev,9
switch (@key)
 {
 case -3:-2
 goto exit
 break
 case 1
 GeoType=CKpoint
 dosub buildget.cdp
 break
 case 2
 GeoType=CKline
 dosub buildget.cdp
 break
 case 3
 MenuLev=MenuLev+1
 getmenu "Select 3-D Polyline type", "Open",\
 "Closed",, , , . , , ,MenuLev, 1
 switch (@key)
 {
 case -3:-2
 goto exit
 case 1
 Ptype = Open
 break
 case 2
 Ptype = Closed
 break
 case 3:9
 break
 default
 break
 }
 GeoType=CKpline
 dosub buildget.cdp
 MenuLev=MenuLev-1
 break
 case 4
 MenuLev=MenuLev+1
 getmenu "Select 3-D Spline type", "Open",\
 "Closed" , , , , , ,MenuLev,1
 switch (@key)
 {
 case -3:-2
 goto exit
 case 1
 Stype = Open
 break
 case 2
 Stype = Closed
 break
 case 3:9
 break
 default
 break
 }
 GeoType=CKspline
 dosub buildget.cdp
 MenuLev=MenuLev-1
 break
 case 5
 goto top
 reak
 case 6
 ModeNum=ModeNum+1
 if (ModeNum > 3)
 ModeNum=Manual
 break
 case 7
 dosub plnmenu.cdp
 break
 case 8
 dosub control.cdp
 break
 case 9
 Menu=2
 dosub 3drhelp.cdp
 break
 default 3DBUILD.CDP Tuesday, July 27, 199311:29 pm Page 2
Menu=2
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 MenuLev=MenuLev-1
EXIT
3DRCNFGR.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem 3DRCNFGR.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 STRING $fname[0],$dummy[0]
 FileErr=0
 CNFGerr=Falεe
 /* Set Up File Name */
 CALL strcpy, $fname, @cwd
 CALL street, $fname, "\\RSTUDIO.DAT"
 SET devin, $fname
 INPUT "%s %d", $dummy, ModeNum
if (@ERROR)
 {
 CNFGerr=True
 CLOSE devin
 goto exit
 }
INPUT "%s%d" $dummy, Beep
INPUT "%s%d" $dummy, Points
INPUT "%s%d" $dumny, PointsHS
INPUT "%s%d" $dummy, Finder
INPUT "%s%f" $dumny, Delay
INPUT "%s%d" $dummy, MaxNodes
INPUT "%s %d" $dummy, Pplane
INPUT "%s%f" $dummy, Pdisp
INPUT "%s%d" $dummy, Splane
INPUT "%s%f" $durrmy, Sdisp
INPUT "%s%f" $dumny, GridTol
INPUT "%s%f" $dummy, GridSize
 INPUT "%s%f%f %f", $dummy, Origin[0], Origin[1], Origin[2]
 INPUT "%s %d %d", $dummy, CutCase[0], CutCase[1]
INPUT "%s %f %f %f", $dummy, AutoInc[0] , Autolnc [1 ], AutoInc[2]
CLOSE devin
dosub bldplane.cdp
dosub cutcase.cdp
goto exit
 :exit
EXIT
3DRCNFGW.CDP Tuesday, July 27, 199311:29 pm Page 1 rem 3DRCNFGW.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 STRING $fname[0],Sdummy[0]
 FileErr=0
 CNFGerr=False
 /* Set Up File Name */
 CALL strcpy, $fname, @cwd
 CALL street, $fname, "\\RSTUDIO.DAT"
 SET devout, $fname
 PRINT "ModeNun: %d\n", ModeNum
if (@ERROR)
 {
 CNFGerr=True
 CLOSE devout
 goto exit
 }
PRINT "Beep: %d\n", Beep
PRINT "Points: %d\n", Points
PRINT "PointsHS: %d\n", PointsHS
PRINT "Finder: %d\n", Finder
PRINT "Delay: %f\n", Delay
PRINT "MaxNodes: %d\n", MaxNodes
PRINT "Pplane: %d\n", Pplane
PRINT "Pdisp: %f\n", Pdisp
PRINT "Splane: %d\n", Splane
PRINT "Sdisp: %f\n", Sdisp
PRINT "GridTol: %f\n", GridTol
PRINT "GridSize: %f\n", GridSize
 PRINT "Origin: %f %f %f\n", Origin[0], Origin[1], Origin[2]
PRINT "CutCase: %d %d\n" CutCase[0], CutCase[1]
PRINT "Autoinc: %f %f %f\n", AutoInc[0], AutoInc[1], AutoInc[2]
CLOSE devout
goto exit
 :exit
 SET devout, CON
 EXIT
Sl^STITUTE SHEET (RULE 26)  3DRHELP.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem 3DR Help File
 rem The Replicator
 rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
 rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 MenuCol=White
sys_autovp 0,0
mode draw
cls
on Menu goto About3DR,3DR,3D_BuiId,2D_Draw,Tools,Locate,\
 Control,SetGrid,PlnDisp,About3DR
 :About3DR
note (@xmin+ (@xmax-@xmin)/11 ),\
 (@ymax-(@ymax-@ymin)/11),\
 " The Replicator
 Studio Version 1.0, August 1, 1993 . . .
 Designed for Use with
 Faro's METRECOM IND Product Line
 CADKEY 6 and above
 FastSURF 6 and above
 Author: Stephen Gubelmann
 (C) Copyright 1993 Stephen Gubelmann
 All rights reserved
 For Support Call Stephen Gubelmann at
 213871-8182 (Voice)
 213871-8189 (Fax)",\
0,(@xmax-@xmin)/48,0.8,,LGreen, ,1
mode normal
switch (KeyError)
 {
 case -2
 pause "Security Initialization Anomaly . . ."
 goto exit2
 case -1:0
 pause "Security Anomaly -1:0 . . ."
 goto exit2
 case 1
 if (Emonth == 0)
 {
 pause "Thank you for selecting Replicator Studio . . ."
 goto exit2
 }
 else
 {
 pause "Your License will expire on %d/%d/%d . . .", Emonth, Eday, Eyear
 goto exit2
 }
 case 2
 pause "Security Key Not Found . . ."
 goto exit2
 case 3
 pause "Security Anomaly3 . . ."
 goto exit2
 case 4
 pause "Your License Expired on %d/%d/%d . . .", Emonth, Eday, Eyear
 goto exit2
 case 5
 pause "Security File Anomaly . . ."
 goto exit2
 case 6
 pause "Security Date Anomaly . . ."
 goto exit2
 case 7
 pause "You Are Not Licensed For This Version Of The Replicator."
 goto exit2
 default
 pause "Security Anomaly 7+ . . ."
 goto exit2
 }
goto exit2
 :3DR
note (@xmin+(@xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11),\
 "The Replicator Main Menu Help File . . .
 3D Build = Build Points, Lines, Polylines
 and Splines in 3-D
2D Draw = Build Points, Lines, Polylines
 and Splines in 2-D
Tools = Build Arcs, Circles, Polygons and Views
Locate = Locate Key Points, and measure distances
Mode = Cycle Manual :SemiAuto:Auto:CutPlaneModes
 Manual: Point by Point
 SemiAuto: Point by Point or Press & Hold
 Auto: Press & Hold
 CutPlane: Point by Point on Primary Plane  3DRHELP.CDP Tuesday, July 27, 1993 11:29 pm Page 2
Control = Beep On/Off:Pnts On/Off:Pnts Hide/Show
 Fndr On/Off:AutoPace:MaxNodes:SetGrid
About3DR = About The Replicator Information File
3DR Help = Display Help Information on this menu",\
0,(@xmax-@xmin)/48,0.8, ,MenuCol , ,1
goto exit
 :3D_Build
note (@xmin+(@xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11),\
 "The Replicator 3D Build Help File . . .
 Point = 3-D Point String Generation
Line = 3-D Line String Generation
Polyline = 3-D Polyline String Generation
Spline = 3-D Spline Generation
Mode = Cycle Manual:SemiAuto:Auto:CutPlane Modes
SetGrid = Define Primary and Secondary planes
Control = Beep On/Off:Pnts On/Off:Pnts Hide/Show
 Fndr On/Off:AutoPace:MaxNodes:SetGrid
3DR Help = Display Help Information on this menu",\
0,(@xmax-@xmin)/48,0.8,,MenuCol,,1
goto exit
 :2D_Draw
note (@xmin+(3xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11),\
 "The Replicator 2D Draw Help File . . .
 Point = 2-D Point String Generation
Line = 2-D Line String Generation
Polyline = 2-D Polyline String Generation
Spline = 2-D Spline Generation
 Mode = Cycle Manual:SemiAuto:Auto:CutPlane Modes
SetFrame = Set the Drawing Frame
Control = Beep On/Off:Pnts On/Off:Pnts Hide/Show
 Fndr On/Off:AutoPace:MaxNodes:SetGrid
3DR Help = Display Help Information on this menu",\
0,(@xmax-@xmin)/48,0.8,,MenuCol,,1
goto exit
 :Tools
note (@xmin+(@xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11).\
 "The Replicator Tools Help File . . .
Arc = Define an Arc in 3D using 3 points
Circle = Define a Circle in 3D using 3 points
Polygon = Define a 3 to 8 sided 3D Polygon
View = Define a new CADKEY view with 3 points
Mode = Supports Manual only
Control = Beep On/Off:Pnts On/Off:Pnts Hide/Show
 Fndr On/Off:AutoPace:MaxNodes:SetGrid
3DR Help = Display Help Information on this menu",\
0,(@xmax-@xmin)/48,0.8, ,MenuCol,,1
goto exit
 :Locate
note (@xmin+(@xmax-@xmin)/11),\
 (aymax-(aymax-aymin)/11),\
 "The Replicator Locate Help File . . .
 Track = Real-Time display of probe tip location
Pnt2Pnt = Measure distance between two points
Pnt Near = Locate point closest to Primary Plane
Pnt Far = Locate point farthest from Primary Plane
PntPln X = Locate point on surface at intersection
 of the Primary and Secondary Planes
SetGrid = Must be set for Pnt Near,Pnt Far,PntPln X
3DR Help = Display Help Information on this menu",\
0, (@xmax-@xmin)/48,0.8, .MenuCol,,1
goto exit
 :Control
note (@xmin+(@xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11 ),\
 "The Replicator Control Help File . . .
 Mode = Cycle Manual :SemiAuto:Auto:CutPlane Modes
 Beep = Cycles confermation Beep On/Off
 Pnts = Cycle Points On/Off
 Pnts = Hide or Show Points
 Fndr = Cycle Tracking Finder On/Off
 AutoPace = Set the time delay between Nodes
 default .00 seconds
MaxNodes = Specify manximum nodes to collect in string
 default 100 Nodes
SetGrid = Define Primary and Secondary Planes
3DR Help = Display Help Information on this menu",\
0, (@xmax-@xmin)/48,0.8, .MenuCol,, 1
goto exit
 :SetGrid
note (3xmim(@xmax-@xmin)/11),\ 3DRHELP.CDP Tuesday, July 27, 1993 11:29 pm Page 3
(@yntax-(@ymax-@ymin)/11),\
 "The Replicator SetGrid Help File . . .
 Ppln_ = Cycles Primary Plane through XY/XZ/YZ
 PplnDisp = Set Primary Plane displacement
 Spin _ = Cycles Secondary Plane through XY/XZ/YZ
 SplnDisp = Set Secondary Plane displacement
Grid Tol = Set Grid Tolerance for CutPlane
 default within +/- .025\" of Primary Plane
GridSize = Set Grid Size,
 default 6 Units
Origin = Set New Grid Origin
GridRset = Reset Grid - Sets Ppln & Spin to Null.
 Sets PplnDisp, SplnDisp, & Autoinc to 0.
 Sets Origin to 0, 0, 0. Sets Grid Tol &
 GridSize to default settings.
3DR Help = Display Help Information on this menu",\
0,(@xmax-@xmin)/48,0.8,,MenuCol,,1
goto exit
 :PlnDisp
note (@xmin+(@xmax-@xmin)/11),\
 (@ymax-(@ymax-@ymin)/11),\
 "The Replicator Plane Displacement Help File . . .
 Probe = Use probe to set plane displacement
 Mouse = Use mouse to set plane displacement
 Key In = Key In plane displacement
 Autoinc = Set Autoinc for CutPlane Mode
 3DR Help = Display Help Information on this menu",\
 0, (@xmax-@xmin)/48,0.8, ,MenuCol , , 1
goto exit
 :exit
mode normal
pause "3-D Replicator Help ... press <Enter> to continue"
 :exit2
sys_autovp 7,0
auto -1
redraw -1
 Menu=0
 EXIT
3DR_LOCK.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem 3DR_LOCK.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 STRING $fname[0]
 KeyError=-1
 BadKey=1
 /* Set Up File Name */
 CALL strcpy, $fname, @cwd
 CALL strcat, $fname, "\\3DRCNTL.DAT"
 /* Foil Hacker Dummy File */
SET devout, $fname
PRINT "5\n"
if (@ERR0R)
 {
 KeyError=5
 goto BadFile
 }
CLOSE devout
 /* Check For Key */
 EXEC 1, "CDL\\3DRLOCK 3DR 2"
 /* Get Return Code, Expiration Date, & Entitlements */
SET devin, $fname
 INPUT "%d %d %d %d", KeyError, Emonth, Eday, Eyear, RShop, RStudio
if (@ERROR)
 KeyError=5
CLOSE devin
rem pause "KeyError %d Month %d Day %d Year %d RShop %d RStudio %d",\
rem KeyError, Emonth, Eday, Eyear, RShop, RStudio
on KeyError goto\
 BadRC, GoodKey, NoKey, BadID, Expired, BadFile, BadDate, BadRC
goto BadRC
 :GoodKey
 /* Here if everything is OK */
 BadKey = 0
goto exit
 :NoKey
goto exit
 :BadID
goto exit
 :Expired
goto exit
 :BadFile
goto exit
 :BadDate
goto exit
 :BadRC
goto exit
 :exit
 SET devout, $fname
PRINT "5\n''
if ($ERROR)
 KeyError=5
CLOSE devout
SET devout, CON
EXIT ARC.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem ARCS.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - Al l rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem Creates an ARC using 3 point from probe
local angl , ang2, rraadd,. aarnclen, sysview, ml , m2, b1 , b2, relxl , relx3, relyl , rely3
#define pi 3.1415926536
 ARRAY PntNodes [3H3]
ARRAY Pnt IDs 13]
if (Finder)
 rαint Origin[0] ,Origin[1] ,Origin[2] , Black
 inderID=@lastid
 >
 LastBhit=0
ang=360
rad=1
arcID=0
arclen=1
arcolor=1
arcltype=1
array ptl [3]
array pt2[3]
array pt3 [3]
array pt4[3]
array pt5 [3]
array center [3]
array vmx[9]
 :start
 Nodes=0
 /* 1st two points define direction of X, 3rd defines direction of Y */
for (i=1;i<4;i=i+1)
 SPRINT Spmpt, "Indicate position %1d on arc", i
 PROMPT Spmpt
 :readpos
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 inderID=@lastιd
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 > WHILE (Bhit == None)
 if ((Skey == Del) && (Delete == On))
 goto deleteit
 on Bhit goto readpos, exit, B1hit, exit
 :B1hit
 if (Finder)
 (
 DELENT FinderID
 point Origin [0] ,Origin[1] ,Origin[2] , Black
 F inderID=@lastid
 }
 Mode draw
 point Fx,Fy, Fz, White
 PntNodes [Nodes] [0] = Fx
 PntNodes [Nodes] [1] = Fy
 PntNodes [Nodes] [2] = Fz
 Nodes=Nodes+1
 if (Nodes>1 )
 LINE PntNodes [(Nodes-2)][0],PntNodes [(Nodes-2)] [1] .PntNodes [(Nodes-2)] [2] ,\
 Fx, Fy. Fz,White, ,2
 Mode normal
 Delete=Off
 SWITCH ( i )
 {
 case 1
 pt1[0] = Fx
 pt1 [1] = Fy
 pt1 [2] = Fz
 break
 case 2
 pt2[0] = Fx
 pt2 [1] = Fy
 pt2 [2] = Fz
 break
 case 3
 pt3 [0] = Fx
 pt3[1] = Fy
 pt3 [2] = Fz  ARC.CDP Tuesday, July 27, 1993 11:29 pm Page 2
}
 if (Beep == On)
 print "\007"
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcnt1 & 3
 } WHILE (Bhit == B1)
 }
 /* Compute the X vector and normalize it (unitize) */
 dx = pt2[0] - pt1[0]
 dy = pt2[1] - pt1[1]
 dz = pt2[2] - pt1[2]
 magn = sqrt (dx^2 + dy^2 + dz^2)
 vmx[0] = dx = dx/magn
 vmx[3] = dy = dy/magn
 vmx[6] = dz = dz/magn
 /* Compute the temporary Y vector and normalize it (unitize) */
 dx1 = pt3[0] - pt1 [0]
 dy1 = pt3[1] - pt1[1]
 dz1 = pt3[2] - pt1[2]
 magn = sqrt (dx1^2 + dy1^2 + dz1^2)
 dx1 = dx1/magn
 dy1 = dy1/magn
 dz1 = dz1/magn
 /* calculate the Z vector as a cross product of x X y */
 CALL CROSS, nx, ny, nz, dx, dy, dz, dx1, dy1, dz1
 /* Normalize (unitize) the computed Z vector. */
 magn = sqrt (nx^2 + ny^2 + nz^2)
 vmx[2] = nx = nx/magn
 vmx[5] = ny = ny/magn
 vmx[8] = nz = nz/magn
 /* Re-compute the Y vector and normalize it (unitize) */
 CALL CROSS, dx1, dy1, dz1, nx, ny, nz, dx, dy, dz
 magn = sqrt (dx1^2 + dyT2 + dz1 2)
 vmx[1] = dx1/magn
 vmx [4] = dy1/magn
 vmx[7] = dz1/magn
 /* resulting view matrix has 3 vectors 90 degrees to one another and
 oriented according to the right hand rule. Each is a unit length.
 This is a properly defined view. Any other will generate the error
 message: "View Matrix is Bogus" */
 /* Define a view, get the system view number and redefine the system view */
/* CADL view numbers are not the same as CADKEY system views !! Create #100 */
 VIEW 100, vmx[0], vmx[1], vmx[2], \
 vmx[3], vmx[4], vmx[5], \
 vmx[6], vmx[7], vmx[8]
 /* With view now in the system identify the CADKEY system view */
 CALL CDLV2SYSV, 100, sysview
 /* Now value known, redefine view so CADL view = CADKEY view numbers */
 VIEW sysview, vmx[0], vmx[1], vmx[2], \
 vmx [3], vmx [4], vmx [5], \
 vmx[6], vmx[7], vmx[8]
 /* transform 3 points to new view coordinates */
call xfmwv, vmx, pt1[0], pt1[1], pt1[2], pt1[0], pt1[1], pt1[2]
call xfmwv, vmx, pt2[0], pt2[1], pt2[2], pt2[0], pt2[1], pt2[2]
call xfmwv, vmx, pt3[0], pt3[1], pt3[2), pt3[0], pt3[1], pt3[2]
 /* now have 3 pts in view coordinates, Zv constant for circle, solve rad */
 /* define slopes of lines pt1->pt2, pt2->pt3, check for divide by zero? */
/* add a later check for coincident positions ... must be 3 unique pts */
ml = (pt2[1]-pt1[1])/(pt2[0]-pt1[0))
m2 = (pt3[1]-pt2[1])/(pt3[0]-pt2[0])
 /* construct perpendicular bisectors of the two lines with slopes ml, m2 */
pt4[0]=(pt1[0]+pt2[0])/2
pt4[1)=pt1[1]
pt5[0] =(pt2[0] +pt3[0])/2
pt5[1]=(pt2[1]+Pt3[1])/2
 /* pt4[1)=(pt1[1]+pt2[1])/2 *** by definition of view Y constant pt1->pt2 */
 /* m4=-1/m1 is a divide by zero, since ml shows the direct io of XV */
m5=-1/m2
 /* b4 = pt4[1]-m4*pt4[0] can't be used since slope will be infinite */
b5 = pt5[1]-m5*pt5[0]
 /* intersection of the two perpendicular bisectors is the arc center */
 /* first bisector must be vertical line in new view */
 /* center[0] = (b5-b4)/(m4-m5) remove due to divide by zero problems */
center[0] = pt4[0]
center [1] = m5*center[0] + b5
 /* Z is unchanged for all pts */
center[2] = pt1[2]  ARC.CDP Tuesday, July 27, 199311:29 pm Page 3
/* now have center position, can calculate radius and relative positions */
rad = sqrt(((pt1 [0] -center[0] )^2)+((pt1 [1] -center[1])^2))
relx1 = pt1 [0] -center[0]
rely1 = ptl [1] -center [1]
relx3 = pt3[0] -center [0]
rely3 = pt3[1] -center [1]
 /* calculate angles for arc in arc view coordinates */
if (rely1==0)
 {
 if (relx1>0)
 ang1=0
 else
 ang1=180
 goto angle2
 }
if (rely1 > 0)
 ang1 = acos(relx1/rad)
 else
 ang1 = 360 - acos(relx1/rad)
 :angle2
if (rely3==0)
 {
 if (relx3>0)
 ang2=0
 else
 ang2=180
 goto doit
 }
if (rely3 > 0)
 ang2 = acos(relx3/rad)
 else
 ang2 = 360 - acos(relx3/rad)
 :doit
 CLS -1
redraw -1
 Mode normal
arc center[0], center[1], center[2], rad, ang1, ang2, sysview
 LastEnt=@lastid
if (Points)
 for (n=0; n<Nodes; n=n+1)
 {
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n==2)
 ColCode=Green
 point PntNodes [n] [0] , PntNodes [n] [1] ,PntNodes [n] [2] ,ColCode,@level+1
 PntIDs [n] =3lastid
 }
Delete=On
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point Origin[0],Origin[1] ,Origin[2] ,Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :deleteit
Delete=Off
DELENT LastEnt
if (Points)
 for (n=0; n<3: n=n+1)
 DELENT PntIDs[n]
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point Origin[0] ,Origin[1] ,Origin[2] , Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :exit
 Mode normal
clear PntNodes,PntIDs,pt1, pt2, pt3, pt4, pt5, center, vmx
if (Finder)
 DELENT FinderID
EXIT  BLDPLANE.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem BLDPLANE.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem DEFATTR fcolor
:top
 PSdisp=Pdisp
PlaneCol-13
if (PplnEnt[0])
 DELENT PplnEnt[0]
 DELENT PplnEnt[1]
 PplnEnt[0] =PplnEnt[1]=0
on Pplane goto ,XY,XZ,YZ
 Pplane=0
 Pdisp=0
 :top2
 Pass=2
 PSdisp=Sdisp
 PlaneCol=10
if (SplnEnt[0])
 DELENT SplnEnt[0]
 DELENT SplnEnt [1]
 SplnEnt[0] =SplnEnt[1]=0
on Splane goto ,XY,XZ,YZ
 Splane=0
 Sdisp=0
goto exit
 :XY
 ARRAY PlnDef1[4l[3]
 PlnDef1[0][0]=PlnDef1[3] [0]=Origin[0]+(GridSize*-1)
 PlnDef1[1][0]=PlnDef1[2][0]=Origin[0]+GridSize
 PlnDefl [2] [1]=PlnDef1[3][1]=Origin[1]+(GridSize*-1)
 PlnDefl [0] [1]=PlnDef1 [1] [1]=Origin[1]+GridSize
 PlnDefl [0] [2]=PlnDef1[1][2]=PlnDef1[2][2]=PlnDef1[3][2)=Origin[2]+PSdisp
 ARRAY PlnDef2[4][3]
 PlnDef2[0][0]=PlnDef2[3][0]=Origin[0]+((GridSize/3)*-1)
 PlnDef2[1] [0]=PlnDef2[2] [0]=Origin[0]+(GridSize/3)
 PlnDef2[2][1]=PlnDef2[3][1)=Origin[1]+((GridSize/3)*-1)
 Ptrt)ef2[0][1]=PlnDef2[1][1]=Origin[1]+(GridSize/3)
 Plrt)ef2[0][2]=PlnDef2[1][2]=PlnDef2[2][2]=PlnDef2[3][2]=Origin[2]+PSdisp
 Goto BldPlane
 :XZ
 ARRAY PlnDef 1[4][3]
 PlnDef1[0][0)=PlnDef1[3][0)=Origin[0]+(GridSize*-1)
 PlnDef1[1][0]=PlnDef1[2][0]=Origin[0]+GridSize
 PlnDef1[2][2]=PlnDef1[3][2]=Origin[2)+(GridSize*-1)
 PlnDef1[0][2]=PlnDef1[1][2]=Origin[2]+GridSize
 PlnDef1[0][1]=PlnDef1[1][1]=PtnDef1[2][1]=PlnDef1[3][1]=Origin[1]+PSdisp
 ARRAY PlnDef2[4][3]
 PlnDef2[0] [0]=PlnDef2[3] [0]=Origin[0]+((GridSize/3)*-1)
 PlnDef2[1] [0]=PlnDef2[2] [0]=Origin[0]+(GridSize/3)
 PlnDef2[2] [2]=PlnDef2[3] [2]=Origin[2]+((GridSize/3)*-1)
 PlrDef2[0][2]=PlnDef2[1][2)=Origin[2]+(GridSize/3)
 PlnDef2[0] [1]=PlnDef2[1] [1]=PlnDef2[2][1]=PlnDef2[3][1]=Origin[1]+PSdisp
 Goto BldPlane
 :YZ
 ARRAY PlnDefl [4] [3]
 PlnDefl [0] [1)=PtnDef1 [3] [1]=Origin[1)+(GridSize*-1)
 PlnDefl [1] [1]=Plrt)ef 1 [2] [1]=Origin[1)+GridSize
 PlnDefl [2][2]=PlnDef1[3l[2]=Origin[2]+(GridSize*-1)
 PlnDefl [0] [2]=PlnDef 1 [1] [2]=Origin[2]+GridSize
 PlnDefl [0] [0]=PlnDef 1 [1] [0]=PlnDef1[2] [0]=PlnDef1[3][0]=Origin[0]+PSdisp
 ARRAY PlnDef2[4][3]
 PlnDef2[0][1]=PlnDef2[3][1]=Origin[1]+((GridSize/3)*-1)
 PlnDef2[1][1]=PlnDef2[2][1]=Origin[1]+(GridSize/3)
 PlnDef2[2][2]=PlnDef2[3][2]=Origin[2]+((GridSize/3)*-1)
 PlnDef2[0][2]=PlnDef2[1][2]=Origin[2]+(GridSize/3)
 PlnDef2[0][0]=PlnDef2[1][0]=PlnDef2[2][0]=PlnDef2[3][0]=Origin[0]+PSdisp
 Goto BldPlane
 :BldPlane
if (Pass==1)
 {
 POLYLINE 4,PlnDef1,2,2,2,1,Red,,2
 PplnEnt[0]=@lastid
 POLYLINE 4,PlnDef2,2,2,2,1,Red,,2
 PplnEnt[1]=@lastid
 goto top2
 }
if (Pass==2)
 POLYLINE 4,PlnDef1,2,2,2,1,Green,,2
 SplnEnt [0]=@lastid BLDPLANE.COP Tuesday, July 27, 199311:29 pm Page 2
POLYLINE 4,PlnDf2,2,2,2,1,Green,,2
 SplnEnt[1]=@lastid
 goto exit
 }
 :exit
auto -1
redraw -1
EXIT
BUILDGET.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem BUILDGET.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem This program will allow 3-D points to be input in a stream.
clear Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Center=NoFill=1
if (Finder)
 roint Origin[0],Origin[1],Origin[2] , Black
 inderID=@lastid
 }
: restart
LstNodes=0
 ARRAY PntNodes [MaxNodes] [XYZ]
ARRAY PntIDs [MaxNodes]
ARRAY LineIDs [MaxNodes]
on ModeNum goto Manual , SimiAuto, Auto, Cut_Pln0, exit
 :Manual
 LastBhit=Bhit=Nodes=NodeErr=0
:top0
promp "B1 Press=Start B2=End B2/ESC=exit Nodes = %d",Nodes
:top1
DO
 {
 readdev Fcnt1,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 FinderID=alastιd
 }
 Bhit = Fcnt1 & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto top1, B201, B101, top1
 :B101
if (Finder)
 {
 DELENT FinderlD
 point Origin[0],Origin[1] ,Origin[2] ,Black
 FinderID=@lastid
 }
Mode draw
Delete=Off
point Fx,Fy, Fz,White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2) = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0] ,PntNodes[(Nodes-2)] [1] ,PntNodes[(Nodes-2)] [2] ,\
 Fx, fy,Fz .Whi te, ,2
Mode normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 {
 pause "MaxNodes - %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit == B1)
goto top0
 :B201
if (Nodes == None)
 goto exit
dosub buildit
if (NodeErr == True)
 {
 NodeErr=False
 goto Manual
 }
Delete=On
LstNodes=Nodes
DO  BUILDGET.CDP Tuesday, July 27, 1993 11:29 pm Page 2 readdev Fcntl.Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B2)
goto Manual
 :Cut PlnO
if (Pplane == NOplane)
 pause "Primary Plane not set. Use \"SetGrid\" to enable CutPlane"
 goto exit
 :Cut Pin
 LastBhit=Bhit=Nodes=NodeErr=0
 :top2
prompt "B1 Press=Start | B2=End | B2/ESC=exit | Nodes = Xd",Nodes
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 roint Fx.Fy.Fz.White
 inderID=alastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto top3, B202, B102, top3
 :B102
 Delete=Off
on CutCaseCO] goto exit, XYpath, XZpath, YZpath, exit
 :XYpath
if ((Fz < ((Origin[2)+Pdisp)-GridTo l )) | | (Fz > ((Origin[2]+Pdisp)+GridTol)))
 goto top3
Fz=Origin[2]+Pdisp
goto jump
 :XZpath
if ((Fy < ((Origin[1]+Pdisp)-GridTol )) | | (Fy > ((Origin[1]+Pdisp)+GridTol)))
 goto top3
Fy=Origin[1]+Pdisp
goto jump
 :YZpath
if ((Fx < ((Origin[0]+Pdisp)-GridTol)) || (Fx > ((Origin[0]+Pdisp)+GridTol)))
 goto top3
Fx=Origin[0]+Pdisp
goto jump
if (Finder)
 {
 DELENT FinderlD
 roint Origin[0] ,Origin[1] ,Origin[2] , Black
 inderID=@lastid
 }
Mode draw
point Fx, Fy, Fz,White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0] .PntNodes [(Nodes-2)] [1] ,PntNodes [(Nodes-2)] [2] ,\
 Fx.Fy.Fz.White, , 2
Mode normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 {
 pause "MaxNodes = %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
DO
 {
 readdev Fcntl,Fx.Fy.Fz, Fa, Fb.Fc
 Bhit = Fcntl & 3
 > WHILE (Bhit == B1)
goto top2
 :B202  BUILDGET.CDP Tuesday, July 27, 1993 11:29 pm Page 3 if (Nodes == None)
 goto exit
dosub buildit.cdp
if (NodeErr == True)
 NodeErr=False
 goto Cut_Pln
 PSplane=1
dosub dispget.cdp
 Delete=On
 LstNodes=Nodes
 DO
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 > WHILE (Bhit == B2)
goto Cut_Pln
 :Auto
 LastBhit=Bhit=Nodes=NodeErr=0
 :top4
prompt "B1 Press/Release=Start/Stop | B2/ESC=exit Nodes = %d",Nodes
 :top5
getkey
if (@key == 27)
 goto exit
if ((@key == Del) && (Delete == On))
 goto deleteit
readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
if (Finder)
 {
 DELENT FinderID
 point Fx.Fy.Fz.White
 FinderID=@lastid
 }
LastBhit = Bhit
Bhit = Fcntl & 3
if ((Bhit == None) && (LastBhit == None))
 goto top5
on Bhit goto Blrel, exit, B103, top5
 :B1rel
if (Nodes == None)
 goto exit
dosub buildit.cdp
if (NodeErr == True)
 {
 NodeErr=False
 goto Auto
 }
 Delete=On
LstNodes=Nodes
goto Auto
 :B103
if (Finder)
 {
 DELENT FinderID
 point Origin[0],Origin[1] ,Origin[2] , Black
 inderID=@lastid
 }
Mode draw
Delete=Off
point Fx. Fy..Fz.White
PntNodes [Nodes] [0] Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0], PntNodes [(Nodes-2)] [1] .PntNodes [(Nodes-2)] [2] ,\
 Fx.Fy.Fz.Whi te, ,2
Mode normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 {
 pause "MaxNodes - %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
Wait Delay
goto top4
goto Auto
 :SimiAuto
 LastBhit=Bhit=Nodes=NodeErr=0
:SAtop0
prompt "B1 Press=Start B2=End | B2/ESC=exit | Nodes = %d",Nodes
:SAtop1
DO
 { BUILDGET.CDP Tuesday, July 27, 1993 11:29 pm Page 4 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 point Fx.Fy.Fz.White
 FinderID=@lastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 { WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto SAtopl, B2SA, B1SA, SAtopl
 :B1SA
if (Finder)
 {
 DELENT FinderlD
 point Origin[0],Origin[1] ,Origin[2] , Black
 FinderID=@lastid
 }
Mode draw
Delete=Off
point Fx, Fy, Fz, White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0] ,PntNodes [(Nodes-2)] [1] ,PntNodes[(Nodes-2)] [2] ,\
 Fx.Fy.Fz.White, , 2
Mode normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 pause "MaxNodes = %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
Wait Delay
goto SAtop0
 :B2SA
if (Nodes == None)
 goto exit
dosub buildit
if (NodeErr == True)
 {
 NodeErr=False
 goto SimiAuto
 }
Delete=On
LstNodes=Nodes
DO
 {
 readdev Fcntl.Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B2)
goto SimiAuto
 :deleteit
Delete=Off
if (Points)
 for (n=0; n<LstNodes; n=n+1)
 DELENT PntlDs[n]
if (GeoType == CKpoint)
 for (n=0; n<LstNodes; n=n+1)
 DELENT PntIDs[n]
if (GeoType == CKline)
 for (n=0; n<(LstNodes-1); n=n+1)
 DELENT LinelDs[n]
if ((GeoType == CKpline) (GeoType == CKspline))
 DELENT LastEnt
LstNodes=0
if (Finder)
 {
 DELENT FinderlD
 auto -1
 roint Origin[0], Origin[1] ,Origin[2] ,Black
 inderID=@lastid
 }
else
 auto -1
redraw -1
goto restart
 :exit
MODE normal BUILDGET.CDP Tuesday, July 27, 199311:29 pm Page 5 clear PntNodes,PntIDs,LineIDs,FcntI,Fx,Fy,Fz
if (Finder)
 DELENT FinderID
EXIT
BUILDIT.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem BUILDIT.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
dosub 3dr_lock.cdp
if (BadKey)
 {
 Menu=0
 dosub 3drhelp.cdp
 ABORT
 }
rstart
MODE normal
if (GeoType==CKpoint)
 for (n=0; n<Nodes; n=n+1)
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n>1)
 ColCode=Gray
 if (n==(Nodes-1))
 ColCode=Green
 point PntNodes [n] [0], PntNodes [n] [1] , PntNodes [n] [2] , ColCode
 PntIDs [n]=@lastid
 }
 }
if (GeoType==CKl ine)
 if (Nodes < 2)
 {
 pause "Lines require 2 Nodes minimum. You entered %d Nodes",Nodes
 redraw -1
 NodeErr=True
 goto exit
 }
 for (n=0; n<(Nodes-1); n=n+1)
 LINE PntNodes [n] [0], PntNodes [n] [1] . PntNodes [n] [2] ,\
 PntNodes [n+1] [0] ,PntNodes[n+1] [1] , PntNodes [n+1) [2] ,@color, ,1
 LineIDs[n]=@lastid
 }
 if (Points)
 for (n=0; n<Nodes; n=n+1 )
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n>1)
 ColCode=Gray
 if (n==(Nodes-D)
 Col[ode=Green
 point PntNodes [n] [0] , PntNodes [n] [1] , PntNodes [n] [2] ,Col[ode,Slevel+1
 PntlDs [n] =3lastid
 >
 >
if (GeoType==[Kpline)
 if ((Nodes < 3) && (Ptype == [ losed))
 pause "Closed Polylines require 3 Nodes minimum. You entered %d Nodes",Nodes
 redraw -1
 NodeErr=True
 goto exit
 if ((Nodes < 2) && (Ptype == Open))
 pause "Open Polylines require 2 Nodes minimum. You entered %d Nodes",Nodes
 redraw -1
 NodeErr=True
 goto exit
 >
 POLYLINE Nodes,PntNodes,3,Ptype,Center,NoFill,acolor
 LastEnt=aiastid
 if (Points)
 for (n=0; rxNodes; Π=ΓH-1)
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n>1)
 ColCode=Gray
 if (n==(Nodes-1))
 Col[ode=Green
 point PntNodes[n][0], PntNodes[n] [1] , PntNodes[n] [2] ,ColCode,@level+1
 PntlDs[n] =3lastid
 }
 }  BUILDIT.CDP Tuesday, July 27, 1993 11:29 pm Page 2 if (GeoType==CKspline)
 if (Nodes < 4)
 {
 pause "Splines require 4 Nodes minimum. You entered %d Nodes",Nodes
 redraw -1
 NodeErr=True
 goto exit
 }
 If (Stype == Open)
 SPLINE P3NN, PntNodes, Nodes, Scolor
 LastEnt=@lastid
 If (Stype == Closed)
 SPLINE P3C, PntNodes, Nodes, Scolor
 LastEnt=Slastid
 }
 if (Points)
 for (n=0; n<Nodes; n=n+1)
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n>1)
 ColCode=Gray
 if (n==(Nodes-D)
 ColCode=Green
 point PntNodes [n][0], PntNodes [n] [1] , PntNodes [n] [2] ,ColCode,@level+1
 PntlDs[n] =@lastid
 }
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point 0,0,0,Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
:exit
EXIT
CIRCLE.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem CIRCLE.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem Creates a Circle using 3 point from probe
local angl, ang2, rad. arclen, sysview, ml, m2, b1, b2, relx1, relx3, relyl, rely3
 #define p 3.1415926536
 ARRAY PntNodes [3 ] [3]
 ARRAY PntIDs[3]
if (Finder)
 {
 point Origin[0], Origin[1] , Origin[2] , Black
 inderID=@lastid
 }
 LastBhit=0
ang=360
rad=1
arcID=0
arclen=1
arcolor=1
arcltype=1
array pt1 [3]
array pt2[3]
array pt3[3]
array pt4 [3]
array pt5 [3]
array center [3]
array vmx[9]
 :start
 Nodes=0
 /* 1st two points define direction of X, 3rd defines direction of Y */
for (i=1;i<4;i=i+1)
 SPRINT Spmpt, "Indicate position %1d on circle", i
 PROMPT Spmpt
 :readpos
 DO
 {
 readdev Fcntl, Fx,Fy,Fz, Fa, Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 FinderID=alastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
 if ((@key == Del) && (Delete == On))
 goto deleteit
 on Bhit goto readpos, exit, B1hit, exit
 :B1hit
 if (Finder)
 {
 DELENT FinderlD
 rsint Origin[0] , Origin[1] ,Origin[2] .Black
 inderID=@lastid
 >
 Mode draw
 point Fx. Fy,Fz.White
 PntNodes [Nodes] [0] = Fx
 PntNodes [Nodes] [1] = Fy
 PntNodes [Nodes] [23 = Fz
 Nodes=Nodes+1
 if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0],PntNodes [(Nodes-2)] [1] ,PntNodes [(Nodes-2)] [2] ,\
 Fx, Fy,Fz,White, .2
 Mode normal
 Delete=Off
 SWITCH (i )
 {
 case 1
 pt1[0) = Fx
 pt1 [1] = Fy
 pt1 [2] = Fz
 break
 case 2
 pt2[0] = Fx
 pt2[1] = Fy
 pt2[2] = Fz
 break
 case 3
 pt3 [0] = Fx
 pt3 [1] = Fy
 pt3 [2] = Fz  CIRCLE.CDP Tuesday, July 27, 199311:29 pm Page 2 if (Beep == On)
 print "\007"
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl 43
 > WHILE (Bhit == B1)
 }
 /* Compute the X vector and normalize it (unitize) */
 dx = pt2[0] - pt1[0]
 dy = pt2[1] - pt1[1]
 dz = pt2[2] - pt1[2]
 magn = sqrt (dx^2 + dy^2 + dz^2)
 vmx[0] = dx = dx/magn
 vmx[3] = dy = dy/magn
 vmx [6] = dz = dz/magn
 /* Compute the temporary Y vector and normalize it (unitize) */
 dxl = pt3[0] - pt1[0]
 dy1 = pt3[1] - pt1[1] .
 dz1 = pt3[2] - ptl [2]
 magn = sqrt (dxl^2 + dy1^2 + dz1^2)
 dxl = dx1/magn
 dyl = dy1/magn
 dz1 = dz1/magn
 /* calculate the Z vector as a cross product of x X y */
 CALL CROSS, nx, ny, nz, dx, dy, dz, dxl, dy1, dz1
 /* Normalize (unitize) the computed Z vector. */
 magn = sqrt (nx^2 + ny^2 + nz^2)
 vmx[2] = nx = nx/magn
 vmx[5] = ny = ny/magn
 vmx[8] = nz = nz/magn
 /* Re-compute the Y vector and normalize it (unitize) */
 CALL CROSS, dx1, dy1, dz1, nx, ny, nz, dx, dy, dz
 magn = sqrt (dx1^2 + dy1^2 + dz1^2)
 vmx[1] = dx1/magn
 vmx[4] = dy1 /magn
 vmx[7] = dz1/magn
 /* resulting view matrix has 3 vectors 90 degrees to one another and
 oriented according to the right hand rule. Each is a unit length.
 This is a properly defined view. Any other will generate the error
 message: "view Matrix is Bogus" */
 /* Define a view, get the system view nunber and redefine the system view */
/* CADL view numbers are not the same as CADKEY system views !! [reate #100 */
 VIEW 100, vmx[0], vmx[1], vmx [2], \
 vmx[3], vmx[4] , vmx[5], \
 vmx[6], vmx[7], vmx[8]
 /* With view now in the system identify the CADKEY system view */
 CALL CDLV2SYSV, 100, sysview
 /* Now value known, redefine view so CADL view = [ADKEY view numbers */
 VIEW sysview, vmx[0] vmx[1], vmx[2], \
 vmx[3], vmx[4], vmx[5], \
 vmx[6], vmx[7], vmx[8]
 /* transform 3 points to new view coordinates */
call xfmwv, vmx, pt1[0], pt1[1], pt1[2], pt1[0], pt1[1], pt1[2]
call xfmwv, vmx, pt2[0], pt2[1], pt2[2] pt2[0], pt2[1], pt2[2]
call xfmwv, vmx. pt3[0], pt3[1], pt3[2], pt3[0], pt3[1], pt3[2]
 /* now have 3 pts in view coordinates, Zv constant for circle, solve rad */
 /*** test code ... draw the three points ***/
rem vpoint pt1[0], ptl [11 , ptl [2], sysview
rem vpoint pt2[0], pt2[1], pt2[2], sysview
rem vpoint pt3[0], pt3[1], pt3[2], sysview
 /* define slopes of lines pt1->pt2, pt2->pt3, check for divide by zero? */
/* add a later check for coincident positions ... must be 3 unique pts */
m1 = (pt2[1]-pt1[1])/(pt2[0]-pt1[0])
m2 = (pt3[1]-pt2[1])/(pt3[0)-pt2[0])
 /* construct perpendicular bisectors of the two lines with slopes m1, m2 */
pt4[0] =(pt1[0]+pt2[0])/2
pt4[1]=pt1[1]
pt5[0] =(pt2[0] +pt3[0])/2
pt5[1]=(pt2[1)+pt3[1])/2
 /* pt4[1)=(pt1[1]+pt2[1])/2 *** by definition of view Y constant pt1->pt2 */
 /* m4=-1/m1 is a divide by zero, since ml shows the directio of XV */
m5=-1/m2
 /* b4 = pt4[1)-m4*pt4[0] can't be used since slope will be infinite */
b5 = pt5[1]-m5*pt5[0)
 /* intersection of the two perpendicular bisectors is the arc center */
 /* first bisector must be vertical line in new view */
 /* center[0] = (b5-b4)/(m4-m5) remove due to divide by zero problems */  CIRCLE.CDP Tuesday, July 27, 199311:29 pm Page 3 center[0] = pt4[0]
 center [1] = m5*center[0] + b5
 /* Z is unchanged for all pts */
center[2] = pt1[2]
 /* test code ... draw new points and reference connecting lines */
 rem vpoint center[0], center[1], center[2), sysview, 2
 rem vpoint pt4[0], pt4[1], pt2[2], sysview
 rem vpoint pt5[0]. pt5[1], pt2[2], sysview
 rem vline center[0], center[1], center[2], pt4[0], pt4[1], pt2[2], sysview, 2
 rem vline center[0], center[1], center[2], pt5[0], pt5[1], pt2[2], sysview, 2
 rem vline center[0], center[1], center[2], pt1[0], pt1[1], pt1[2], sysview, 4
rem vline center[O), center[1], center[2], pt3[0], pt3[1], pt3[2], sysview, 4
 /* now have center position, can calculate radius and relative positions */
rad = sqrt(((pt1C0]-center[01)^2)+((pt1[1]^center[1])^2))
relx1 = pt1[0] -center[0]
relyl = pt1[1]-center[1]
relx3 = pt3[0] -center[0]
rely3 = pt3[1] -center[1]
 /* calculate angles for arc in arc view coordinates */
if (rely1==0)
 {
 if (relx1>0)
 ang1=0
 else
 ang1=180
 goto anglez
 }
if (relyl > 0)
 angl - acos(relx1/rad)
 else
 angl = 360 - acos(relx1/rad)
 :angle2
if (rely3==0)
 if (relx3>0)
 ang2=0
 else
 ang2=180
 goto doit
if (rely3 > 0)
 ang2 = acos(relx3/rad)
 else
 ang2 = 360 - acos(relx3/rad)
 :doit
 CLS -1
redraw -1
 Mode normal
circle center[0], center [1], center[2], rad, sysview
 LastEnt=3lastid
if (Points)
 for (n=0; n<Nodes; n=n+1)
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n==2)
 ColCode=Green
 point PntNodes [n] [0] , PntNodes [n] [1], PntNodes[n][2] ,ColCode,@level+1
 PntIDs[n)=@lastid
 Detete=On
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point Origin[0],Origin[1] ,Origin[2], Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :deleteit
Delete=Off
DELENT LastEnt
if (Points)
 for (n=0; n<3: n=n+1)
 DELENT PntlDs[n]
if (Finder)
 [
 DELENT FinderID
 auto -1
 roint Origin[0], Origind],Origin[2],Black
 FinderID=alastid
 } CIRCLE.CDP Tuesday, July 27, 1993 11:29 pm Page 4 else
 auto -1
redraw -1
goto start
 :exit
 Mode normal
clear PntNodes,PntIDs,pt1, pt2, pt3, pt4, pt5, center, vmx
if (Finder)
 DELENT FinderlD
EXIT
CONTROL.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem CONTROL.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 SLIST $$Beep[0] [0] .$$Pntstr[0] [0]
 MenuLev=MenuLev+1
 LastLev=@level
$$Beep[0] ="Beep-Of f "
$$Beepl1]="Beep-On"
$$Pntstr[0] ="Pnts-Of f "
 S$Pntstr [1]="Pnts-On"
 $$PntHS[0]="PntsHide"
 $$PntHS [1]="PntsShow"
 $$Fndrstr[0] ="Fndr-Off"
$$Fndrstrdl="Fndr-On"
 :top
getmenu "Select Control Function", \
 $$ModeX [ModeNum] ,$$Beep[Beep] ,$$Pntstr[Points] ,$$PntHS[PointsHS],\
 $$Fndrstr[Finder],"AutoPace",'MaxNodes"."SetGrid","3DR Help",MenuLev
switch (@key)
 case -3:-2
 goto exit
 ModeNum=ModeNum+1
 if (ModeNum > 3)
 ModeNum=Manual
 break
 case 2
 Beep = (1 # Beep)
 if (Beep == On)
 print "\007"
 break
 case 3
 Points = (1 # Points)
 if (Points)
 {
 PointsHS=Show
 dosub displev.cdp
 ]
 else
 {
 PointsHS=Hide
 dosub displev.cdp
 }
 break
 case 4
 PointsHS = (1 # PointsHS)
 dosub displev.cdp
 break
 case 5
 Finder = (1 # Finder)
 break
 case 6
 getflt "Enter new time delay in seconds (%.2f):",Delay,Delay
 break
 case 7
 getint "Enter new MaxNodes (%d):",MaxNodes,MaxNodes
 break
 case 8
 dosub plnmenu.cdp
 break
 case 9
 Menu=6
 dosub 3drhelp.cdp
 break
 default
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 MenuLev=MenuLev-1
EXIT  CUTCASE.CDP Tuesday, July 27, 1993 11 :29 pm Page 1 rem CUTCASE.CDP
rem The Repl icator
rem (C) Copyright 1993 Stephen Gubelmann - Al l rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
if ((Pplane == NOplane) && (Splane == NOplane))
 CutCase[0] =0
 CutCase[1]=0
 goto exit
if ((Pplane == XYplane) && (Splane == NOplane))
 CutCase[0]=1
 CutCase[1]=0
 goto exit
 }
if ((Pplane == XZplane) && (Splane == NOplane))
 CutCase[0]=2
 CutCase[1]=0
 goto exit
 }
if ((Pplane == YZplane) && (Splane == NOplane))
 CutCase[0]=3
 CutCase[1]=0
 goto exit
 }
if ((Pplane == XYplane) && (Splane == XZplane))
 CutCase[0]=1
 CutCase[1]=1
 goto exit
 }
if ((Pplane == XYplane) && (Splane == YZplane))
 CutCase[0]=1
 CutCase[1]=2
 goto exit
 }
if ((Pplane == XZplane) && (Splane == XYplane))
 CutCase[0] =2
 CutCase[1]=3
 goto exit
 }
if ((Pplane == XZplane) && (Splane == YZplane))
 CutCase[0]=2
 CutCase[1]=4
 goto exit
if ((Pplane == YZplane) && (Splane == XYplane))
 CutCase[0] =3
 CutCase[1]=5
 goto exit
 }
if ((Pplane == YZplane) && (Splane == XZplane)}
 CutCase[0]=3
 CutCase[1]=6
 goto exit
if (Pplane == Splane)
 if (Pplane == XYplane)
 CutCase[0]=1
 if (Pplane == XZplane)
 CutCase[0] =2
 if (Pplane == YZplane)
 CutCase[0] =3
 CutCase[1]=7
 goto exit
 }
 :exit
EXIT DISPGET.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem DISPGET.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem This program will allow 3-D points to be input in a stream.
clear Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 MenuLev=MenuLev+1
if (Finder)
 {
 point 0,0,0,Black
 FinderID=@lastid
 }
:top
getmenu "Select Displacement Selection Method",\
 "Probe", "Mouse" "Key In", "AutoInc"," - " ," - ",\
 " - ", " - ","3DR Help",MenuLev,9
switch (@key)
 case -3:-2
 goto exit
 break
 case 1
 if (PSplane == 1)
 prompt "Probe Select Primary Plane. . ."
 if (PSplane == 2)
 prompt "Probe Select Secondary Plane. . ."
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 point Fx,Fy,Fz,White
 inderID=@lastid
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 > WHILE (Bhit != B1)
 if (Beep == On)
 print "\007"
 if (PSplane == 1)
 if (Pplane == XYplane)
 Pdisp=Fz-Origin[2]
 if (Pplane == XZplane)
 Pdisp=Fy-Origin[1]
 if (Pplane == YZplane)
 Pdisp=Fx-Origin[0]
 dosub bldplane.cdp
 goto exit
 }
 if (PSplane == 2)
 {
 if (Splane == XYplane)
 Sdisp=Fz-Origin[2]
 if (Splane == XZplane)
 Sdisp=Fy-Origin[1]
 if (Splane == YZplane)
 Sdisp=Fx-Origin[0]
 dosub bldplane.cdp
 goto exit
 }
 goto exit
 case 2
 getpos "Indicate Position. . .",2
 if (Beep == On)
 print "\007"
 if (PSplane == 1)
 if (Pplane == XYplane)
 Pdisp=@ZWORLD-Origin[2]
 if (Pplane == XZplane)
 Pdisp=@YWORLD-Origin[1]
 if (Pplane == YZplane)
 Pdisp=@XWORLD-Origin[0]
 dosub bldplane.cdp
 goto exit
 }
 if (PSplane == 2)
 if (Splane == XYplane)
 Sdisp=@ZWORLD-Origin[2]
 if (Splane == XZplane)
 Sdisp=@YWORLD-Origin[1]
 if (Splane == YZplane)
 Sdisp=@XWORLD-Origin[0]
 dosub bldplane.cdp
 goto exit
 }
 goto exit  DISPGET.CDP Tuesday, July 27, 1993 11:29 pm Page 2 case 3
 if (PSplane == 1)
 getflt "Enter Primary Plane Displacement (%.4f):",Pdisp,Pdisp
 if (PSplane == 2)
 getflt "Enter Secondary Plane Displacement (%.4f):",Sdisp,Sdisp
 dosub bldplane.cdp
 goto exit
 case 4
 if (PSplane == 1)
 getflt "Enter +/- Primary Plane Displacement Increment (%.4f): ",\
 AutoInc[PSplane],AutoInc[PSplane]
 Pdisp=Pdisp+AutoInc[PSpIane]
 if (PSplane == 2)
 {
 getflt "Enter +/- Secondary Plane Displacement Increment (%.4f): ",\
 Autoinc[PSplane],AutoInc[PSplane]
 Sdisp=Sdisp+AutoInc[PSpIane]
 dosub bldplane.cdp
 goto exit
 case 5:8
 break
 case 9
 Menu=8
 dosub 3drhelp.cdp
 break
 default
 Menu=8
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 MenuLev=MenuLev-1
if (Finder)
 DELENT FinderID
EXIT
DISPLEV.CDP Tuesday, July 27, 199311:29 pm Page 1 rem DISPLEV.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 INT DispMask[16],Bin[17]
 :top
 ARRAY Bin[17]={0, 1 , 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768}
 DispMask [0] =@levels[0]
 DispMask[1]=@levels[1]
 DispMask [2] =@levels[2]
 DispMask [3] =@levels13]
 DispMask [4] =@levels[4]
 DispMask[5]=@levels[5]
 DispMask [6] =@levels[6]
 DispMask [7] =@levels[7]
 DispMask [8] =@levels[8]
 DispMask [9] =@levels[9]
 DispMask[10]=@levels[10]
 DispMask[11]=@levels[11]
 DispMask[12]=@levels[12]
 DispMask[13]=@levels[13]
 DispMask[14]=@levels[14]
 DispMask[15]=@levels[15]
 Slevel=floor((@level+1)/16)
Ilevel=((((@level+1)/16)-Slevel)*16)
if (PointsHS)
 DispMask[Slevel]=(DispMask[Slevel] | Bin[I level])
else
 DispMask[Slevel]=(DispMask[Slevel] # Bin[I level])
SET levelmask, DispMask
redraw -1
:exit
EXIT
DRAWGET.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem DRAWGET.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
clear Fcntl, Fx.Fy.Fz,Fa,Fb.Fc
 Center=NoFill=1
if (Finder)
 point 0,0,0,Black
 FinderID=@lastid
 |
 :restart
 LstNodes=0
 ARRAY PntNodes [MaxNodes] [XYZ]
 ARRAY PntIDs [MaxNodes]
 ARRAY LineIDs [MaxNodes]
on ModeNum goto Manual, SimiAuto, Auto, exit
 :Manual
 LastBhit=Bhit=Nodes=NodeErr=0
 :top0
prompt "B1 Press=Start | B2=End | B2/ESC=exit | Nodes = %d",Nodes
 :top1
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 point Fx,0,Fy,White
 inderID=@lastid
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto top1, B201, B101, topi
 :B101
if (Finder)
 {
 DELENT FinderlD
 point 0,0,0,Black
 FinderID=@lastid
 }
Mode draw
Delete=Off
point Fx,0,Fy,White
PntNodes[Nodes] [0] = Fx
PntNodes [Nodes] [1] = 0
PntNodes [Nodes] [2] = Fy
Nodes=Nodes+1
if (Nodes>1)
 LINE PntNodes [(Nodes-2)] [0],PntNodes [(Nodes-2)] [1],PntNodes[(Nodes-2)] [2],\
 Fx,0,Fy,White,,2
Mode Normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 pause "MaxNodes = %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
DO
 {
 readdev Fcntl,Fx,Fy,Fz, Fa,Fb,Fc
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit == 81)
goto top0
 :B201
if (Nodes == None)
 goto exit
dosub buildit
if (NodeErr == True)
 {
 NodeErr=False
 goto Manual
 }
Delete=On
LstNodes=Nodes  DRAWGET.CDP Tuesday, July 27, 1993 11:29 pm Page 2
DO
 {
 readdev Fcntl, Fx,Fy,Fz, Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B2)
goto Manual
 :Auto
 LastBhit=Bhit=Nodes=NodeErr=0
 :top4
prompt "B1 Press/Release=Start/Stop | B2/ESC=exit | Nodes = %d",Nodes
getkey
if (@key == 27)
 goto exit
if ((@key == Del) && (Delete == On))
 goto deleteit
readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
if (Finder)
 {
 DELENT FinderlD
 point Fx,O,Fy,White
 FinderID=@lastid
 }
LastBhit = Bhit
Bhit = Fcntl & 3
if ((Bhit == None) && (LastBhit == None))
 goto top5
on Bhit goto Blrel, exit, B103, top5
 :B1rel
if (Nodes == None)
 goto exit
dosub buildit.cdp
if (NodeErr == True)
 [
 NodeErr=False
 goto Auto
 }
Delete=On
LstNodes=Nodes
goto Auto
 :B103
if (Finder)
 {
 DELENT FinderlD
 point 0,0,0,Black
 FinderID=aiastid
 }
 Mode draw
Delete=Off
point Fx,0, Fy,White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = 0
PntNodes [Nodes] [2] = Fy
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0], PntNodes [(Nodes-2)] [1] , PntNodes [[Nodes-2)] [2] ,\
 Fx,0,Fy,White, ,2
Mode normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 [
 pause "MaxNodes = %d reached. Increase MaxNodes using \"Control:MaxNodes\".",MaxNodes
 redraw -1
 goto exit
 }
Wait Delay
goto top4
goto Auto
 :SimiAuto
 LastBhit=Bhit=Nodes=NodeErr=0
:SAtop0
prompt "B1 Press=Start | B2=End | B2/ESC=exit | Nodes = %d",Nodes
:SAtop1
DO
 {
 readdev Fcntl, Fx,Fy,Fz, Fa, Fb.Fc
 if (Finder)
 }
 DELENT FinderlD
 point Fx,0,Fy,White
 FinderID=@lastid
 {
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop  DRAWGET.CDP Tuesday, July 27, 199311:29 pm Page 3
} WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto SAtop1, B2SA, B1SA, SAtop1
 :B1SA
if (Finder)
 {
 DELENT FinderlD
 point 0,0,0,Black
 FinderID=@lastid
 }
Mode draw
Delete=Off
point Fx,0,Fy,White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = 0
PntNodes [Nodes] [2] = Fy
Nodes=Nodes+1
if (Nodes>1)
 LINE PntNodes [(Nodes-2)] [0], PntNodes [(Nodes-2)] [1] , PntNodes [(Nodes-2)] [2] ,\
 Fx,0, Fy,White, ,2
Mode Normal
if (Beep == On)
 print "\007"
if (Nodes == MaxNodes)
 {
 pause "MaxNodes = %d reached. Increase MaxNodes using \"Control :MaxNodes\"-",MaxNodes
 redraw -1
 goto exit
 }
Wait Delay
goto SAtop0
 :B2SA
if (Nodes == None)
 goto exit
dosub buildit
if (NodeErr == True)
 {
 NodeErr=False
 goto SimiAuto
 }
Delete=On
LstNodes=Nodes
DO
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B2)
goto SimiAuto
 :deleteit
Delete=Off
if (Points)
 for (n=0; n<LstNodes; n=n+1)
 DELENT PntIDs[n]
if (GeoType == CKpoint)
 for (n=0; n<LstNodes; n=n+1)
 DELENT PntIDs[n]
if (GeoType == CKline)
 for (n=0; n<(LstNodes-1); n=n+1)
 DELENT LineIDs[n]
if ((GeoType == CKpline) || (GeoType == CKspline))
 DELENT LastEnt
LstNodes=0
if (Finder)
 {
 DELENT FinderID
 auto -1
 point 0,0,0,Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto restart
 :exit
 MODE normal
clear PntNodes,PntIDs,LineIDs,Fcntl,Fx,Fy,Fz
if (Finder)
 DELENT FinderID
EXIT  LOCATE.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem LOCATE.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 MenuLev=MenuLev+1
 :top
 PntNF=None
getmenu "Select Locate Option",\
 "Track", "Pnt2Pnt", "Pnt Near", "Pnt Far", "PntPln X",\
 " - " ," - ", "SetGrid", "3DR Help", MenuLev, 9
switch (@key)
 case -3
 goto exit
 case -2
 goto exit
 case 1
 dosub track.cdp
 break
 case 2
 dosub mpnt2pnt.cdp
 break
 case 3
 PntNF=Near
 dosub pntnf.cdp
 break
 case 4
 PntNF=Far
 dosub pntnf.cdp
 break
 case 5
 dosub pntplnx.cdp
 break
 case 6
 break
 case 7
 break
 case 8
 dosub plnmenu.cdp
 break
 case 9
 Menu=5
 dosub 3drhelp.cdp
 break
 default
 Menu=5
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 MenuLev=MenuLev-1
EXIT
MPNT2PNT.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem MPNT2PNT.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem This program measures the distance between two points.
rem ESC exit
f loat PntDist
 ARRAY PointsAB [2] [3]= {0, 0,0, 0,0,0}
 ARRAY PntID[2]={0,0}
if (Finder)
 point 0,0,0,Black
 FinderID=@lastid
 }
clear Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
:start
 Fcntl=Fx=Fy=Fz=LastBhit=Bhit=PntN=PntDist=LineID=Delete=0
 ARRAY PointsAB[2] [3]={0,0,0,0,0,0}
 ARRAY PntID[2]={0,0}
 Count=1
 :top0
prompt "B1=Get Point %d | B2/ESC=exit",Count
 :top
 DO
 {
 readdev Fcntl, Fx,Fy,Fz,Fa, Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 point Fx,Fy,Fz,White
 FinderID=@lastid
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit == None)
on Bhit goto top, B201, B101, exit
 :B201
if (Finder)
 {
 DELENT FinderID
 point 0,0,0, Black
 FinderID=@lastid
 }
if (Delete == On)
 {
 Delete=Off
 If (PntID[0] != 0)
 DELENT PntID [0]
 If (PntID [1] != 0)
 DELENT PntID [1]
 If (LineIDI=0)
 DELENT LineID
 goto start
 }
goto exit
 :B101
if (Finder)
 {
 DELENT FinderID
 point 0,0,0, Black
 FinderID=@lastid
 }
if (Delete == On)
 {
 Delete=Off
 If (PntID[0] != 0)
 DELENT PntID[0]
 If (PntID [1] ! = 0)
 DELENT PntID [1]
 If (LineID!=0)
 DELENT LineID
 Count=1
 PntN=0
 }
if (Count == 1)
 point Fx,Fy, Fz, Red
if (Count == 2)
 point Fx, Fy,Fz, Blue
PntID [PntN]=@lastid
PointsAB[PntN] [0]=Fx
PointsAB [PntN] [1] =Fy
PointsAB [PntN] [2] =Fz
if (Beep == On)
 print "\007"
Count= Count+1
PntN=PntN+1  MPNT2PNT.CDP Tuesday, July 27, 1993 11:29 pm Page 2
DO
 {
 readdev Fcntl,Fx,Fy,Fz, Fa,Fb,Fc
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit == B1)
if (PntN == 2)
 goto Measure
goto top0
 PntDist=sqrt(((PointsAB[0] [0]-PointsAB[1] [0])^2)+\
 ((PointsAB[0][1]-PointsAB[1][1])^2)+\
 ((PointsAB[0] [2]-PointsAB[1] [2])^2))
Line PointsAB[0] [0], PointsAB[0] [1], PointsAB[0] [2],\
 PointsAB[1] [0],PointsAB[1] [1], PointsAB[1] [2], White,, Dashed
LineID=@lastid
auto -1
redraw -1
on @units goto Inch, Mili, Feet, Cent, Yards, Meters
:Inch
prompt "Distance Between Point A and B = %.4f Inches", PntDist
goto Done
:Mili
prompt "Distance Between Point A and B = %.4f Milimeters", PntDist
goto Done
:Feet
prompt "Distance Between Point A and B = %.4f Feet", PntDist
goto Done
:Cent
prompt "Distance Between Point A and B = %.4f Centimeters", PntDist
goto Done
: Yards
prompt "Distance Between Point A and B = %.4f Yards", PntDist
goto Done
:Meters
prompt "Distance Between Point A and B = %.4f Meters", PntDist
:Done
Delete=On
goto top
 :exit
 If (PntID[0] != 0)
 DELENT PntID[0]
If (PntID[1] != 0)
 DELENT PntID[1]
If (LineID!=0)
 DELENT LineID
clear PointsAB, PntID
if (Finder)
 DELENT FinderID
auto -1
redraw -1
EXIT
ORIGIN.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem ORIGIN.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem Sets the XYZ Origin of the Grid Planes
clear Fcntl,Fx,Fy,Fz,Fa, Fb,Fc
MenuLev=MenuLev+1
if (Finder)
 {
 point Origin[0], Origin [1] , Origin[2] , Black
 FinderID=@lastid
 }
:top
getmenu "Select Displacement Selection Method",\
 "Probe","Mouse","Key In"," - "," - "," -",\
 "- "," -","3DR Help",MenuLev,9
switch (@key)
 {
 case -3:-2
 goto exit
 break
 case 1
 prompt "Probe Select Grid Plane Origin. . ."
 {
 readdev Fcntl,Fx,Fy,Fz,Fa, Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 point Fx, Fy,Fz, White
 inderID=@lastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit != B1 )
 if (Beep == On)
 print "\007"
 Origin[0]=Fx
 Origin[1]=Fy
 Origin[2]=Fz
 Pdisp=Sdisp=0
 dosub bldplane.cdp
 goto exit
 case 2
 getpos "Indicate Grid Plane Origin. . .",2
 if (Beep == On)
 print "\007"
 Orιgin[0]=@XWORLD
 Origin[1]=@YWORLD
 Origin[2]=@ZWORLD
 Pdisp=Sdisp=0
 dosub bldplane.cdp
 goto exit
 case 3
 getf lt "Enter New X Grid Origin (%.4f):", Origin[0], Origin[0]
 getflt "Enter New Y Grid Origin (%.4f) :", Origin[1] , Origin[1]
 getflt "Enter New Z Grid Origin (%.4f ) :",Origin[2] , Origin[2)
 Pdisp=Sdisp=0
 dosub bldplane.cdp
 goto exit
 case 4:8
 break
 case 9
 Menu=8
 dosub 3drhelp.cdp
 break
 default
 Menu=8
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 MenuLev=MenuLev-1
if (Finder)
 DELENT FinderID
EXIT  PLNMENU.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem PLNMENU.CDP
 rem The Replicator
 rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
 rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 SLIST $$Ppln[0] [0],$$Spln[0] [0]
 MenuLev=MenuLev+1
 PSplane=0
$$Ppln[0] ="Ppln "
$$Ppln[1]="Ppln XY"
$$Ppln[2]="Ppln XZ"
$$Ppln[3]="Ppln YZ"
 $$Spln[0]="Spln "
$$Spln[1]="Spln XY"
$$Spln[2] ="Spln XZ"
$$Spln[3]="Spln YZ"
 :top
getmenu "Select Plane Settings",\
 $$Ppln[Pplane) ,"PplnDisp",$$Spln[Splane] , "SplnDisp", \
 "Grid Tol", "GridSi ze", "Origin", "GridRset", "3DR Help", MenuLev, 1
switch (@key)
 case -3:-2
 goto exit
 case 1
 Pplane=Pplane+1
 if (Pplane > 3)
 Pplane=NOplane
 Pdisp=0
 dosub bldplane.cdp
 break
 case 2
 PSplane=1
 dosub dispget.cdp
 break
 case 3
 Splane=Splane+1
 if (Splane > 3)
 Splane=NOplane
 Sdisp=0
 dosub bl dplane.cdp
 break
 case 4
 PSplane=2
 dosub dispget.cdp
 break
 case 5
 getflt "Enter new grid tollerance (%.4f):",GridTol,GridTol
 reak
 case 6
 getflt "Enter new Grid Size (%.2f):",GridSize,GridSize
 dosub bldplane.cdp
 break
 case 7
 dosub origin.cdp
 break
 case 8
 Pplane=0
 Pdisp=0
 Splane=0
 Sdisp=0
 GridTol=.0250
 GridSize=6.00
 ARRAY Origin[3]={0,0,0}
 ARRAY AutoInc[3]={0,0,0}
 dosub bldplane.cdp
 break
 case 9
 Menu=7
 dosub 3drhelp.cdp
 break
 default
 Menu=7
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
dosub cutcase.cdp
clear $$Ppln.$$Spln
MenuLev=MenuLev-1
EXIT  PNTNF.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem PNTNF.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem This program locates Points Near/Far in relation to the Primary Plane.
rem ESC exit
 Delete=Off
 OldPoint=0
clear Fcntl,Fx.Fy.Fz, Fa, Fb.Fc
if (Pplane==NOplane)
 Pause "Error: Primary Plane not set. Use \"SetGrid\" first."
 goto exit
 "start
 Fcntl=Fx=Fy=Fz=Bhit=LastBhit=Count=LastPnt=0
if (PntNF == Far)
 {
 LastFx=Origin[0]+Pdisp
 LastFy=Origin[1]+Pdisp
 LastFz=Origin[2]+Pdisp
 }
if (PntNF == Near)
 {
 LastFx=Origin[0]+1200
 LastFy=Origin[1]+1200
 LastFz=Origin[2]+1200
 }
 :top
prompt "B1=Sample Point %d | B2/ESC=exit",Count
 :top1
getkey
if (@key == 27)
 goto exit
if ((@key == Del) && (Delete == On))
 goto deleteit
readdev Fcntl, Fx.Fy.Fz, Fa, Fb. Fc
LastBhit = Bhit
Bhit = Fcntl & 3
if ((Bhit == None) && (LastBhit == None))
 goto top1
on Bhit goto B1rel, exit, B101, exit
 :B1rel
Delete=On
OldPoint=LastPnt
goto start
 :B101
on PntNF goto exit, near, far
 :near
 Delete=Off
if (Pplane==XYplane)
 if ((abs((Fz)-(Origin[2]+Pdisp))) < (abs((LastFz)-(Origin[2]+Pdisp))))
 {
 If (LastPnt)
 DELENT LastPnt
 point Fx.Fy.Fz.@color
 if (Beep == On)
 print "\007"
 LastPnt = @lastid
 LastFz=Fz
 Count=Count+1
 goto top
 }
 }
if (Pplane==XZplane)
 {
 if ((abs((Fy)-(Origin[1]+Pdisp))) < (abs((LastFy)-(Origin[1]+Pdisp))))
 {
 If (LastPnt)
 DELENT LastPnt
 point Fx,Fy,Fz,@color
 if (Beep == On)
 print "\007"
 LastPnt = Slastid
 LastFy=Fy
 Count=Count+1
 goto top
 }
 }
if (Pplane==YZplane)
 {
 if ((abs((Fx)-(Origin[0]+Pdisp))) < (abs((LastFx)-(Origin[0]+Pdisp))))
 {
 If (LastPnt)
 DELENT LastPnt
 point Fx,Fy,Fz.@color
 if (Beep == On)
 print "\007"  PNTNF.CDP Tuesday, July 27, 1993 11:29 pm Page 2
LastPnt = Slastid
 LastFx=Fx
 Count=Count+1
 goto top
 }
 }
goto top
 :far
 Delete=Off
if (Pplane==XYplane)
 if ((abs((Fz)-(Origin(2]+Pdisp))) > (abs((LastFz)-(Origin[2]+Pdisp))))
 If (LastPnt)
 DELENT LastPnt
 point Fx,Fy,Fz,@color
 if (Beep == On)
 print "\007"
 LastPnt = @lastid
 LastFz=Fz
 Count=Count+1
 goto top
 }
 }
if (Pplane==XZplane)
 if ((abs((Fy)-(Origin[1]+Pdisp))) > (abs((LastFy)-(Origin[1]+Pdisp))))
 If (LastPnt)
 DELENT LastPnt
 point Fx,Fy,Fz,@color
 if (Beep == On)
 print "\007"
 LastPnt = @lastid
 LastFy=Fy
 Count=Count+1
 goto top
 }
 }
if (Pplane==YZplane)
 if ((abs((Fx)-(Origin[0]+Pdisp))) > (abs((LastFx)-(Origin[0]+Pdisp))))
 If (LastPnt)
 DELENT LastPnt
 point Fx,Fy,Fz,@color
 if (Beep == On)
 print "\007"
 LastPnt = Slastid
 LastFx=Fx
 Count=Count+1
 goto top
 }
 }
goto top
 :deleteit
Delete=Off
DELENT OldPoint
auto -1
redraw -1
goto start
 :exit
EXIT
PNTPLNX.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem PNTPLNX.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem This program will allow 3-D points to be input in a stream.
clear Fcntl,Fx,Fy,Fz, Fa, Fb,Fc
if (Finder)
 {
 point 0,0,0,Black
 FinderID=@lastid
 }
 :Cut_Pln0
if (CutCase[1] == 0)
 goto NoSplane
if (CutCase[1] == 7)
 goto NoX
goto Cut_Pln
 :NoSplane
pause "Secondary Plane not specified. Use\"Set Grid\" to enable."
goto exit
 :NoX
pause "Primary Plane and Secondary Plane do not intersect."
goto exit
 :Cut_Pin
 LastBhit=Bhit=Nodes=DeIete=0
 :top2
prompt "B1 Press=Start | B2=End | B2/ESC=exit"
 DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 inderID=@lastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto top3, B202, B102, top3
 :B102
on CutCase[1] goto NoSplane, XYXZpath, XYYZpath, XZXYpath,\
 XZYZpath, YZXYpath, YZXZpath, NoX
:XYXZpath
if ({Fz < ((Origin[2]+Pdisp)-GridTol)) |(Fz > ((Origin[2]+Pdisp)+GridTol )))
 goto top3
if ((Fy < ((Origin[1]+Sdisp)-GridTol)) (Fy > ((Origin[1]+Sdisp)+GridTol )))
 goto top3
Fz=Origin[2]+Pdisp
Fy=Origin[1]+Sdisp
goto jump
 :XYYZpath
if ((Fz < ((Origin[2]+Pdisp)-GridTol)) (Fz > ((Origin[2]+Pdisp)+GridTol )) )
 goto top3
if ((Fx < ((Origin[0]+Sdisp)-GridTol )) (Fx > ((Origin[0]+Sdisp)+GridTol ))
 goto top3
Fz=Origin[2]+Pdisp
Fx=Origin[0]+Sdisp
goto jump
 :XZXYpath
if ((Fy < ((Origin[1]+Pdisp)-GridTol ))) | | (Fy > ((Origin[1]+Pdisp)+GridTol )))
 goto top3
if ((Fz < ((Origin[2]+Sdisp)-GridTol )) | | (Fz > ((Origin[2]+Sdisp)+GridTol )))
 goto top3
Fy=Origin[1]+Pdisp
Fz=Origin[2]+Sdisp
goto jump
 :XZYZpath
if ((Fy < ((Origin[1]+Pdisp)-GridTol )) | | (Fy > ((Origin[1]+Pdisp)+GridTol )) )
 goto top3
if ((Fx < ((Origin[0]+Sdisp)-GridTol )) | | (Fx > ((Origin[0]+Sdisp)+GridTol )) )
 goto top3
Fy=Origin[1]+Pdisp
Fx=Origin[0]+Sdisp
goto jump  PNTPLNX. CDP Tuesday, July 27, 1993 11 :29 pm Page 2
:YZXYpath
 if ((Fx < ((Origin[0]+Pdisp)-GridTol )) | | (Fx > ((Origin[0]+Pdisp)+GridTol)))
 goto top3
if ((Fz < ((Origin[2]+Sdisp)-GridTol)) | | (Fz > ((Origin[2]+Sdisp)+GridTol )))
 goto top3
Fx=Origin[0]+Pdisp
Fz=Origin[2]+Sdisp
goto jump
 :YZXZpath
if ((Fx < ((Origin[0]+Pdisp)-GridTol)) | | (Fx > ((Origin[0]+Pdisp)+GridTol)))
 goto top3
if ((Fy < ((Origin[1]+Sdisp)-GridTol)) || (Fy > ((Origin[1]+Sdisp)+GridTol)))
 goto top3
Fx=Origin[0]+Pdisp
Fy=Origin[1]+Sdisp
goto jump
it (Beep == On)
 print "\007"
if (Finder)
 {
 DELENT FinderlD
 point 0,0,0,Black
 inderID=@lastid
 }
Delete=On
point Fx,Fy,Fz,Scolor
LastEnt=Slastid
Nodes=1
redraw -1
DO
 {
 readdev Fcntl.Fx,Fy,Fz, Fa, Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B1)
goto top2
 :B202
goto exit
 :deleteit
DELENT LastEnt
redraw -1
goto Cut_Pln
 :exit
clear Fcntl,Fx.Fy.Fz
if (Finder)
 DELENT FinderlD
redraw -1
EXIT
POLYGON.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem POLYGON.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem program will allow closed polygons to be input in 3-D
 Fx=Fy=Fz=stype=LastBhit=LstNodes=0
ARRAY polygoon[10] [3]
ARRAY PntNodes [10] [3]
ARRAY PntlDs[10]
if (Finder)
 rsint Origin[0],Origin[1] ,Origin[2],Black
 inderID=@lastid
 }
 :start
n=0
 Nodes=0
 :readpos
prompt "B1=Start | B2=End Polygon | Nodes = %d",Nodes
DO
 }
 readdev Fcntl,Fx.Fy.Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 FinderID=@lastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto readpos, done, B1hit, exit
 :B1hit
if (Finder)
 {
 DELENT FinderlD
 rαint Origin[0], Origin[1] , Origin[2] , Black
 inderID=@lastid
 }
Mode draw
point Fx.Fy.Fz.White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0],PntNodes [(Nodes-2)] [1] ,PntNodes [(Nodes-2)] [2] ,\
 Fx.Fy. Fz, White, ,2
Mode normal
Delete=Off
polygoon[n] [0] = Fx
polygoon[n] [1] = Fy
polygoon[n] [2] = Fz
i f (Beep == On)
 print "\007"
n=n+1
if (n == 8)
 goto done
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B1)
goto readpos
 :done
if (Nodes == None)
 goto exit
if (Nodes < 3)
 pause "Polygons require 3 Nodes minimum. You entered %d Nodes",Nodes
 redraw -1
 Mode normal
 goto start
 CLS -1
redraw -1
Mode normal
 POLYGON 1.0,n, polygoon, Scolor
LastEnt=alastιd
if (Points)
 for (n=0; n<Nodes; n=n+1)  POLYGON.CDP Tuesday, July 27, 199311:29 pm Page 2 if (n==0)
 ColCode=Red
 if (n==1 )
 ColCode=Blue
 if (n>1 )
 ColCode=Gray
 if (n==(Nodes-D)
 Col Code=Green
 point PntNodes [n] [0] , PntNodes [n] [1] , PntNodes [n] [2] ,ColCode,@level+1
 PntlDs[n] =@lastid
 }
Delete=On
LstNodes=Nodes
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point Origin[0] ,Origind] ,Origin[2) , Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :deleteit
Delete=Off
DELENT LastEnt
if (Points)
 for (n=0; n<LstNodes; n=n+1)
 DELENT PntlDs[n]
LstNodes=0
if (Finder)
 {
 DELENT FinderlD
 auto -1
 point Origin[0], Origin[1] ,Origin[2] , Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :exit
 Mode normal
clear PntNodes,PntIDs,polygoon,Fx,Fy,Fz, Fcntl
if (Finder)
 DELENT FinderID
EXIT
SETFRAME.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem SETFRAME.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
clear Fcntl,Fx.Fy.Fz, Fa, Fb.Fc
ARRAY Frame[4] [3]
if (FrameEnt)
 {
 DELENT FrameEnt
 FrameEnt=0
 }
 :Start
 ARRAY PntNodes [4] [3]
 Bhit=0
prompt "Select lower left hand of page with Probe."
DO
 {
 readdev Fcntl.Fx,Fy,Fz, Fa, Fb.Fc
 Bhit = Fcntl 43
 getkey
 if (S@key == 27)
 goto exit
 } WHILE (Bhit != B1 )
Frame[0] [0] =Fx
Frame[0] [1]=0
Frame[0] [2)=Fy
if (Beep == On)
 print "\007"
prompt "Select upper right hand of page with Probe.
 {
 readdev Fcntl, Fx,Fy, Fz, Fa, Fb, Fc
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 > WHILE (Bhit ! = B1 )
 Frame [2] [0] =Fx
 Frame [2) [1]=0
 Frame[2] [2]=Fy
if (Beep == On)
 print "\007"
 Frame [ 1] [0]=Frame [2] [0]
 Frame [1] [1]=0
 Frame [1] [2]=Frame[0] [2]
 Frame [3] [0]=Frame[0] [0]
 Frame [3] [1]=0
 Frame [3] [2]=Frame[2] [2]
 POLYLINE 4,Frame,2,2,2,1,White ,,2
FrameEnt=@lastid
 :exit
auto -1
redraw -1
clear Frame,Fcntl, Fx,Fy,Fz
 EXIT
STUDIO.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem STUDIO.CDP
 rem The Replicator
 rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
 rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
 rem 3D BuiId
 rem 2D Draw
 rem Tools
 rem Locate
rem Manual, SemiAuto, Auto, CutPlane
rem Control
rem About3DR
rem 3DR Help
 /* Type Declarations */
SLIST $$ModeX[0] [0]
 FLOAT Delay, Pdisp, Sdisp, PSdisp, GridTol , GridSize, AutoInc[0]
 STRING Sstrl [9] ,$str2[9] ,$GetPmt [40] ,$GOTCHA [0] , SB ridge [80]
 INT B1 , B2, None, On,Off , Beep, Open, Closed, True, False, Bhit, LastBhit, NodeErr
 INT MaxNodes, ManGOff ,ManGOn, Auto, White, Dashed, Near, Far, CutCase[0], ColCode
 INT XYplane, XZplane, YZplane, Pplane, Splane, Stype, Ptype, Ponly,PandS
 INT Finder, FileErr
 DOUBLE PntNodes[0] [0], Fcntl, Fx,Fy,Fz,PplnEnt[0] ,SplnEnt[0], Origin[0]
 /* String Lists */
$$ModeX [0] ="Manua I"
$$ModeX [1 ] ="Semi Auto"
$$ModeX [2]="Auto"
$$ModeX [3] ="CutPlane"
 /* ARRAY Inital ization */
ARRAY PplnEnt [2] ={0,0}
ARRAY SplnEnt [2] =(0,0}
ARRAY Origin[3]={0,0,0}
ARRAY [ut[ase [2]={0,0}
ARRAY AutoInc[3] ={0,0,0}
 /* INT Globals Inital ization */
 B1=2
 B2=1
 On=1
 Off=0
 Open=1
 Closed=2
 None=0
 True=1
 False=0
 Manual=0
 ΛutoM=1
 CutPlane=2
 White=15
 Gray=14
 Black=0
 Red=2
 LRed=13
 Blue=8
 Green=1
 LGreen=10
 Dashed=2
 NOplane=0
 XYplane=1
 XZplane=2
 YZplane=3
 Stype=0
 Ptype=0
CKpoint=1
CKl ine=2
CKpl ine=3
 CKspl ine=4
 GeoType=0
 Near=1
 Far=2
 FinderID=0
 Hide=0
 Show=1
CNFGerr=False
 /* GOTCHA TRAP */
 $GOTCHA="ahctog"
 BadKey=1
 KeyError=-1
 Emonth=0
 Eday=0
 Eyear=0
 RShopyO
 RStudio=0
 /* INT Global Switches Initialization */
 XYZ=3
 FrameEnt=0
 Del=83
 Delete=Off
 NodeErr=False STUDIO.CDP Tuesday, July 27, 1993 11:29 pm Page 2
/* INT Keyboard Definitions */
 KBesc=-3
 KBback=KBf10=-2
 KBenter=KBreturn=- 1
 HenuLev=1
 Menu=0
 ColCode=White
 /* FLOAT Globals Initial ization */
PSdisp=0
dosub 3drcnfgr.c dp
if (CNFGerr)
 {
 /* Configeration Defaults */
 ModeNum=Manual
 Beep=On
 Points=Off
 PointsHS=Hide
 Finder=On
 Delay=0.00
 MaxNodes=100
 Pplane=0
 Pdisp=0
 Splane=0
 Sdisp=0
 GridTol=.0250
 GridSize=6.00
 ARRAY 0rigin[3] =(0,0,0}
 ARRAY CutCase[2] ={0,0}
 ARRAY AutoInc [3]={0,0,0}
 dosub 3drcnfgw.cdp
 }
 :preamble
dosub 3dr_lock.cdp
Menu=0
dosub 3drhelp.cdp
if (BadKey)
 goto exit
SET coord,1
SET const,1
 :top
if (BadKey)
 goto exit
getmenu "Select Replicator Options from menu. . ,",\
 "3D Bui Id","2D Draw","Tools","Locate"," ",\
 $$ModeXCModeNum] ."Control","About3DR","3DR Help",MenuLev,9
switch (@key)
 {
 case -3:-2
 goto exit
 break
 case 1
 dosub 3dbuild.cdp
 break
 case 2
 dosub 2ddraw.cdp
 break
 case 3
 dosub tools.cdp
 break
 case 4
 dosub locate.cdp
 break
 case 5
 /*dosub test.cdp*/
 break
 case 6
 ModeNum=ModeNum+1
 if (ModeNum > 3)
 ModeNum=Manual
 goto top
 case 7
 dosub control.cdp
 break
 case 8
 dosub 3dr lock.cdp
 Menu=0
 dosub 3drhelp.cdp
 if (BadKey)
 goto exit
 break
 case 9
 Menu=1
 dosub 3drhelp.cdp
 break
 default
 Menu=1
 dosub 3drhelp.cdp
 break
 } STUDIO.CDP Tuesday, July 27, 1993 11:29 pm Page 3 goto top
 :exit
prompt "Exiting Studio. . ."
if (PplnEnt[0])
 DELENT PplnEnt [0]
 DELENT PplnEnt [1]
 PplnEnt [0] =PplnEnt [1] =0
if (SplnEnt[0])
 DELENT SplnEnt[0]
 DELENT SplnEnt [1]
 SplnEnt [0] =SplnEnt [1]=0
auto -1
redraw -1
dosub 3drcnfgw.cdp
 EXE[ 1 , "CDLW3DRLO[ K 3DR 0"
 CLEAR
EXIT
TOOLS.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem TOOLS.CDP
rem The Replicator
rem Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem FRLINES - point to point line string (or single)
rem FRLINESQ - point to point line string NO BEEP
rem FRTRACE - linestring (like a simple polyline)
rem FRPOINT - points in space
rem FRSPLNE - spline using 30 points
rem FRARCS - 3-D Arcs using 3 points
rem FRCIRCS - 3-D Circles using 3 points
rem FRVW - 3 points to pick a view plane
rem FRPOLY - to create a polygon (3-10 sided)
 MenuLev=MenuLev+1
 :top
getmenu "Select Tool","Arc","Circle","Polygon","View",\
 " - ", " - ", "Manual","Control" ,"3DR Help",MenuLev,9
switch (@key)
 {
 case -3
 goto exit
 case -2
 goto exit
 case 1
 dosub arc.cdp
 break
 dosub circle.cdp
 break
 case 3
 dosub polygon.cdp
 break
 case 4
 dosub view.cdp
 break
 case 5
 break
 case 6
 break
 case 7
 break
 case 8
 dosub control.cdp
 break
 case 9
 Menu=4
 dosub 3drhelp.cdp
 break
 default
 Menu=4
 dosub 3drhelp.cdp
 break
 }
goto top
:exit
 HenuLev=MenuLev-1
EXIT
TRACK.CDP Tuesday, July 27, 1993 11:29 pm Page 1 rem TRACK.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
clear Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
if (Finder)
 {
 point Origin[0] , Origind] ,Origin[2] , Black
 FinderID=@lastid
 }
 :start
 Bhit=Delete=0
:top
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 roint Fx,Fy,Fz,White
 inderID=alastιd
 }
 prompt "X = %.4f Y = %.4f Z = %.4f", Fx,Fy,Fz
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 } WHILE (Bhit == None)
if ((Skey == Del) && (Delete == On))
 goto deleteit
on Bhit goto top, exit, B101, top
 :B101
if (Finder)
 {
 DELENT FinderlD
 raint Origin[0],Origin[1] ,Origin[2] ,Black
 inderID=@lastid
 redraw -1
 }
point Fx.Fy,Fz,Scolor
if (Beep == On)
 print "\007"
LstPoint=@lastid
Delete=On
DO
 {
 readdev Fcntl, Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl 43
 } WHILE (Bhit == B1)
goto top
 :deleteit
Delete=Off
DELENT LstPoint
goto start
 :exit
clear Fcntl, Fx,Fy,Fz,Fa,Fb,Fc
if (Finder)
 DELENT FinderlD
auto -1
redraw -1
EXIT VIEW.CDP Tuesday, July 27, 199311:29 pm Page 1 rem VIEW.CDP
rem The Replicator
rem (C) Copyright 1993 Stephen Gubelmann - All rights reserved
rem Designed to work with: Faro Metrecom/CADKEY/FastSURF
rem program will allow 3 point view definition
 ARRAY PntNodes [4] [3]
ARRAY PntIDs[3]
ARRAY LineIDs[3]
array arcm[9]
LastBhit=0
lv=7
sys_autovp 0,0
set view,lv,0
if (Finder)
 {
 point Origin[0], Origin[1] ,Origin[2] ,Black
 inderID=@lastid
 :start
 Nodes=0
prompt "Indicate x,y,z origin of desired view plane. ESC=Exιt"
 :readpos1
 DO
 {
 readdev Fcntl, Fx,Fy,Fz, Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx.Fy.Fz.White
 FinderID=@lastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 if (@key == Del)
 exitloop
 > WHILE (Bhit == None)
if ((@key == Del) && (Delete == On))
 goto deleteit
on Bhit goto readposl, done, Blhita, exit
 :B1hita
if (Finder)
 {
 DELENT FinderlD
 point Origin[0] , Origin[1] ,Origin[2] ,Black
 FinderID=@lastid
 }
Mode draw
point Fx,Fy,Fz,White
PntNodes [Nodes] [0] = Fx
 PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1)
 LINE PntNodes [(Nodes-2)] [0] ,PntNodes[(Nodes-2)] [1] ,PntNodes[(Nodes-2)] [2] ,\
 Fx,Fy,Fz,White, ,2
Mode normal
Delete=Off
x1=Fx
y1=Fy
z1=Fz
if (Beep == On)
 print "\007"
DO
 {
 readdev Fcntl, Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl 43
 } WHILE (Bhit == B1)
prompt "Indicate x positive axis direction for view plane."
:readpos2
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa, Fb,Fc
 if (Finder)
 {
 DELENT FinderID
 rsint Fx,Fy,Fz,White
 inderID=alastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key == 27)
 goto exit
 } WHILE (Bhit == None)
on Bhit goto readpos2, done, Blhitb, exit
 :B1hitb
if (Finder)
 {  VIEW.[DP Tuesday, July 27, 1993 11 :29 pm Page 2
DELENT FinderlD
 point Origin[0] , Origin[1] ,Origin[2] , Black
 F i nder lD=@las tid
 }
 Mode draw
point Fx, Fy, Fz, White
PntNodes [Nodes][0] = Fx
 PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes[(Nodes-2)] [0] ,PntNodes[(Nodes-2)] [1] ,PntNodes[(Nodes-2)] [2] ,\
 Fx,Fy,Fz,White, ,2
Mode normal
x2=Fx
y2=Fy
z2=Fz
if (Beep == On)
 print "\007"
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 Bhit = Fcntl & 3
 } WHILE (Bhit == B1)
prompt "Indicate y positive axis direction for view plane."
:readpos3
DO
 {
 readdev Fcntl,Fx,Fy,Fz,Fa,Fb,Fc
 if (Finder)
 {
 DELENT FinderlD
 point Fx,Fy,Fz,White
 FinderID=alastιd
 }
 Bhit = Fcntl & 3
 getkey
 if (@key ==27)
 goto exit
 } WHILE (Bhit == None)
on Bhit goto readpos3, done, Blhitc, exit
 :B1hitc
if (Finder)
 {
 DELENT FinderlD
 point Origin[0], Origin [1] ,Origin[2] , Black
 inderID=@lastid
 }
Mode draw
point Fx,Fy, Fz, White
PntNodes [Nodes] [0] = Fx
PntNodes [Nodes] [1] = Fy
PntNodes [Nodes] [2] = Fz
Nodes=Nodes+1
if (Nodes>1 )
 LINE PntNodes [(Nodes-2)] [0], PntNodes [(Nodes-2)] [1] , PntNodes [[Nodes-2)] [2] ,\
 Fx,Fy,Fz,White, , 2
Mode normal
x3=Fx
y3=Fy
z3=Fz
if (Beep == On)
 print "\007"
rem * * Make view matrix from 3 coordinates
 dist=sqrt((x2-x1 ) ^2+(y2-y1 )^2+(z2-z1)^2)
 arcm[0]=(x2-x1 )/dist
 arcm[3]=(y2-y1 )/dist
 arcm[6]=(z2-z1 )/dist
 a=x2-x1
 b=x1-x3
 c=y2-y1
 d=y1-y3
 e=z2-z1
 f=z1-z3
 u=-(a*b+c*d+e*f)/(a^2+c^2+e^2)
 arcmd]=x3-a*u-x1
 arcm[4]=y3-c*u-y1
 arcm[7]=z3-e*u-z1
 dist=sqrt(arcm(1] ^2+arcm[4] ^2+arcm[7] ^2)
 IF (abs (dist) > .000001)
 GOTO matrix
 PAUSE "Points co- linear. Can' t make view"
 IF (@key < -1 )
 GOTo exit
 GOTO start
 :matrix
 arcm[1]=arcm[1]/dist
 arcm[4] =arcm[4] /dist
 arcm[2)=arcm[3] *arcm[7] -arcm[6) *arcm[4]  VIEW.CDP Tuesday, July 27, 1993 11 :29 pm Page 3 arcm[5]=arcm[6]*arcm[1] -arcm[0]*arcm[7]
 arcm[8]=arcm[0]*arcm[4] -arcm[3]*arcm[1]
 :done
if (Nodes == None)
 goto exit
if (Nodes < 3)
 {
 pause "Views require 3 Nodes minimum. You entered %d Nodes", Nodes
 CLS -1
 redraw -1
 Mode normal
 goto start
 }
CLS -1
redraw -1
Mode normal
 REM Define the view and add the ci rcle.
 View 1 ,arcm[0] ,arcm[1] , a rem [2] ,arcm[3] ,arcm[4] ,arcm[5] ,arcm[6] ,arcm[7] ,arcm[8]
CALL cdlv2sysv,1 , lv
 View Iv.arcm[0] ,arcm[1] ,arcm[2] ,arcm[3] ,arcm[4) ,arcm[5] , a rem [6] ,arcm[7] ,arcm[8]
Set view. lv
LstView=lv
 PntNodes [3] [0] =PntNodes [0] [0]
PntNodes [3] [1]=PntNodes [0] [1]
PntNodes [3] [2] =PntNodes [0] [2]
for (n=0; n<Nodes; n=n+1 )
 {
 LINE PntNodes [n] [0] ,PntNodes [n] [1] , PntNodes [n] [2] ,\
 PntNodes [n+1] [0], PntNodes [n+1] [1] , PntNodes [n+1] [2] .Gray, , 2, , , 2
 LineIDs[n]=@lastid
 }
if (Points)
 for (n=0; n<Nodes; n=n+1 )
 if (n==0)
 ColCode=Red
 if (n==1)
 ColCode=Blue
 if (n>1)
 ColCode=Gray
 if (n==(Nodes-1))
 ColCode=Green
 point PntNodes [n] [0] ,PntNodes [n] [1] , PntNodes [n] [2] ,ColCode,@level+1
 PntlDs[n] =@lastid
 }
Delete=On
if (Finder)
 {
 DELENT FinderID
 auto -1
 point Origin[0], Origin[1] ,Origin[2] ,Black
 FinderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :deleteit
 Delete=Off
sys_delvp LstView
for (n=0; n<3: n=n+1)
 DELENT LinelDsCn]
if (Points)
 for (n=0; n<3; n=n+1)
 DELENT PntlDs[n]
lv=7
set view.lv,2
if (Finder)
 {
 DELENT FinderlD
 auto -1
 rsint Origin[0] ,Origin[1] ,Origin[2] ,Black
 inderID=@lastid
 }
else
 auto -1
redraw -1
goto start
 :exit
 Mode normal
clear PntNodes,PntlDs,PntlDsI,LinelDs,arcm,dist
if (Finder)
 DELENT FinderlD
sys_autovp 7,0
SET view,lv,2
auto -1
redraw -1
EXIT