CA2250822A1 - Higher order construction algorithm method for rapid prototyping - Google Patents

Higher order construction algorithm method for rapid prototyping Download PDF

Info

Publication number
CA2250822A1
CA2250822A1 CA002250822A CA2250822A CA2250822A1 CA 2250822 A1 CA2250822 A1 CA 2250822A1 CA 002250822 A CA002250822 A CA 002250822A CA 2250822 A CA2250822 A CA 2250822A CA 2250822 A1 CA2250822 A1 CA 2250822A1
Authority
CA
Canada
Prior art keywords
file
num
name
print
loop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
CA002250822A
Other languages
French (fr)
Inventor
Charles L. Thomas
Cheol H. Lee
Srinivas Kaza
Thomas M. Gaffney
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Utah Research Foundation UURF
Original Assignee
University Of Utah Research Foundation
Charles L. Thomas
Cheol H. Lee
Srinivas Kaza
Thomas M. Gaffney
The University Of Utah
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University Of Utah Research Foundation, Charles L. Thomas, Cheol H. Lee, Srinivas Kaza, Thomas M. Gaffney, The University Of Utah filed Critical University Of Utah Research Foundation
Publication of CA2250822A1 publication Critical patent/CA2250822A1/en
Abandoned legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4097Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by using design data to control NC machines, e.g. CAD/CAM
    • G05B19/4099Surface or curve machining, making 3D objects, e.g. desktop manufacturing
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B29WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
    • B29CSHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
    • B29C64/00Additive manufacturing, i.e. manufacturing of three-dimensional [3D] objects by additive deposition, additive agglomeration or additive layering, e.g. by 3D printing, stereolithography or selective laser sintering
    • B29C64/30Auxiliary operations or equipment
    • B29C64/386Data acquisition or data processing for additive manufacturing
    • B29C64/393Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
    • B33Y50/00Data acquisition or data processing for additive manufacturing
    • B33Y50/02Data acquisition or data processing for additive manufacturing for controlling or regulating additive manufacturing processes
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/49Nc machine tool, till multiple
    • G05B2219/49011Machine 2-D slices, build 3-D model, laminated object manufacturing LOM
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/49Nc machine tool, till multiple
    • G05B2219/49014Calculate number and form of 2-D slices automatically from volume on screen
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

A rapid prototype modeling system (20) operates to first electronically decompose a discrete part represented by an STL file into electronic layers, using a paradigm characterized by a higher than zero order of fit with respect to the surface of the part. Physical layers are generated from the electronic layers by mechanical devices constructed and arranged to operate in accordance with the paradigm. The physical layers are then stacked appropriately to create a physical model of the discrete part.

Description

HIGHER ORI)ER CONSTRUCTION ALGORITHM
MElllOD FOR RAPID PROTOTYPING

S TECHNI(~AL FIELD
This invention relates to rapid ylololyye modeling techniques. It is particularly directed to the use of higher order algo~ s for the construction ofsolid pfololy~e parts derived from 3D CAD software-generated models.

BACKGROUND ART
To remain competitive in a global m~rkPt, manufacturers are called upon to bring a variety of products to market with continu~lly decreasing lead times anddevelopment costs. These commercial realities are a driving force dem~n~iing thedevcloy.,lcnt of improved rapid prototyping techniquec.
A rapid yrololy~2g technique (RP) is considered for purposes of this disclosure to include any automatic t~ mi-lue for producing a solid three Aim~.ncional object from a computer ~c.cict~d drawing (CAD) representation of the object. RP systems typically require minim~l skill and interaction on the part of the ope.dtor. Most RP systems are quite flexible, allowing the creation of 20 practically any shape the designer can im~gine. RP thus inherently allows thecl~lion of models that are difflcult or impossible to construct by other techniques.
While there ex~st cignifir~nt dirÇe.~ilces between RP systems, RP generally produces parts that fit within a build volume of less than about a cubic meter (typically a th~rd of a cubic meter), builds these parts at a rate of approximately 2.54 vertical 25 c~ c.~ (one vertical inch) per hourt and normally provides an accuracy withinthe range of about 0.2 % - 0.5 % of model ~imf~n.cions, with a lower limit of 0.0127 cçntimeter (cm) (0.005 inches). The cost for a part from an RP service bureau anges up to several thousand dollars for a part that fills the build volume.
RP techniques are useful for producing small parts, such as disk drive cases, 30 ~ oll~ hand sets, piston rods and the like. However, if the part to be prototyped is large; e.g., a car, the wing of an aircraft, or the support housing for a co ~IlP.J~;ial power generator, the part must be generated in pieces, and the pieces then assembled. The resulting part typically requires days to construct, and its cost of construction is proportionately very high.

CA 022F,0822 1998-10-01 The paradigm ~;ul~c;lllly used by most RP techniques has a limited range of applicability. Parts larger than one cubic centimeter and smaller than one cubicmeter are efficiently produced. Outside this range, prototypes either lose accuracy, or become expensive and time con.~uming to construct.
Most RP techniques that are culr~lllly in use operate under a common construction paradigm. Working from a stereolithography format, faceted approximation of the solid model, the model is first decomposed into a series ofparallel cross sections spaced at a distance equal to the eventual thickness of the construction layers. The part is then constructed by generating these layers from 10 some solid material, and bonding the layers together. The cross sections are physically realized by means of a construction technique characteristic of the specirlc RP system utili7:ed There are several commercially available rapid prototyping processes, each using a unique production process for creating prololyl~e models. A few of the 15 more popular rapid prototyping techniques are Stereolithography (SLA), photo exposure layering (PEL), l~min~ted object manuf~chlrin~ (LOM), selective laser sintering (SLS), and fused deposition modeling (FDM). SLA-based systems solidifyeach layer from liquid photopolymer. LOM-based systems cut each layer from a sheet material. SLS-based systems fuse layers of powder into each cross section 20 shape. These techniques construct each layer with essentially vertical edges,creating a generalized cylinder. For purposes of this disclosure, they are considered to rely upon the "vertical cylinder paradigm" (VCP). These vertical cylinders result in a stepped profile in a prototype r~r~sellling a part that does not in fact have vertical edges. VCP produces a good representation of objects that have only 25 vertical surfaces in at least one axis. The accuracy of the representation decreases as the surface shape becomes more general and the layer thickness employed increases.
An example of an alternative paradigm currently in use for RP applications is in the "Protoforrn" software produced by Pentari. The operating paradigm usedby Protoform is referred to in this disclosure as the "flat pattern paradigm" (FPP).
By this RP system, a solid model is tessçll~ed into flat polygon surfaces and then unfolded into a flat pattern. Tabs are generated at the cut edges, and the resulting pattern is plotted. The pattern is cut, folded, and tabs are joined, creating a three CA 022~0822 1998-10-01 W O 97/37317 PCT~US97/05419 ~limenci~nal object. RP using FPP produces only the surface of an object, thereby requiring very little construction material. Accurate representations of curved or domed surfaces require very small tes.sell~tions, which are difficult to create. Thus, a relatively crude approximation is produced by this approach applied to non-planar 5 surfaces.
- While each of the current RP systems is useful, each has at least one significant limitation. Some general examples of these limit~ti(lns include: large procurement cost, expensive prototype production costs, and the use of resins and polymers that produce harmful gasses. Most importantly, all of them are limited to 10build volumes of less than about a cubic meter, and in some cases less than 0.02832 cubic meter (a cubic foot (ft3)).
As presently understood, merely modifying existing RP machines would not enable effective operation ~igni~lc~ntly outside the currently available manufacturing envelope. Making vertical cylinders faster could pr~unlably expand the envelope,15 but an RP machine that is efficient for producing 10 cm prototypes cannot be expected efficiently to produce 10 meter prototypes. There remains a need for anRP system capable of expanding the build volume of current systems. Moreover, inthe construction of large objects, it would be preferable to operate within construction paradigms capable of re~li7ing a closer fit between the prototype and 20 the design part.

DISCLOSURE OF INVENTION
This invention provides an RP system which avoids many of the limit~tions of existing systems. It expands the build volume of prototype parts through the use 25 of higher order paradigms. It also provides a system, including machine components, capable of implementing software such as that set forth at pages 14 through 117.
Viewed broadly, a rapid prototype system of this invention comprises the steps of electronically decomposing an electronic model of an object into a first ~ 30 series of electronic layers in accordance with a paradigm characterized by a higher than zero order flt with respect to the surface of said object; generating a second series of physical layers from a construction material by mechanical means constructed and arranged to operate in accordance with that paradigm, the second CA 022~0822 1998-10-01 Wo 97/37317 PCT/USg7/05419 series corresponding layer by layer to the first series; and constructing a physical prototype of the object by assembling the physical layers.
The mechanical means for practicing the invention is structured and arranged to provide four degrees of freedom in positioning a cutting device with respect to S sheets of construction material. The mechanical means is generally constructed and arranged to accept and manipulate sheets of construction material 1.22 meters (four feet) wide, or more, and is operated by control means responsive to software equivalent to that set forth at pages 14 through 117.
The mechanical means generally includes support structure, operable to 10 move a sheet of construction material forwards and backwards along a travel path in a plane; an electronically heated wire with a first end held by a first linear positioning device and a second end held by a second linear positioning device, the first and second positioning devices being supported to position the wire transverse the plane to intersect and cut a sheet of construction material traveling on the15 support structure; first structure, mounting the first positioning device such that it may travel back and forth transverse the travel path; second structure, mounting the second positioning device such that it may travel independently of the first positioning device back and forth transverse the travel path; and electronic control means, responsive to operating software, for controlling the relative movements of a 20 sheet of construction material on the support structure, the first positioning means and the second positioning means. The mechanical means may also include heat control means, responsive to the operating software, constructed and arranged toadjust the temperature of the wire. The opeldtil-g software is ideally equivalent to that set forth at pages 14 through 117.
According to this invention, a rapid prototype modeling system operates to first electronically decompose a discrete part ~ sented by an STL file into electronic layers, using a paradigm characterized by a higher than zero order of fit with respect to the surface of the part. Physical layers are geneldled from the electronic layers by mechanical devices constructed and arranged to operate in 30 accordance with the paradigm. The physical layers are then stacked applupliately to create a physical model of the discrete part.
In practice, an electronic model of an object is electronically decomposed into a first series of electronic layers in accordance with a paradigm characterized CA 022~0822 1998-10-01 WO 97/37317 PCTtUS97/05419 _5 by a higher than zero order fit with respect to the surface of the object. A second series of physical layers is gen~rAtPd from a construction material, the second series corresponding layer-by-layer to the first series. This second series of physicallayers is generated by mechanical means constructed and arranged to operate in 5 accordance with the paradigm relied upon for decomposing tl-e electronic model. A
- physical prototype of the object is then constructed by assembling the physical layers. The paradigm has a higher order of fit than that of the vertical cylinder paradigm (VCP) common to RP. It may be selected from either the trapezoidal cylinder paradigm (TCP) or the arc cylinder paradigm (ACP), although other higher 10 order construction al~ori~ ls (HOCA) are operable.
In m~them~tir~l terms, VCP is considered to produce a zero order curve ~lt to the model surface at the edge of each layer. By increasing the order of this fit, this invention produces a more accurate representation at the same layer thickness, and/or increased speed of construction at no less accuracy by increasing the 15 thicknPs,c of the construction layers.
A principle similar to that of the trapezoidal rule, often used in numerical integration, is applied by this invention to the construction of layercd parts, thereby producing a first order curve fit at the layer edge. To apply this trapezoidal cylinder paradigm (TCP), an electronic model is first decomposed into a series of 20 cross sections in conventional RP fashion. Rather than reconstructing each layer based on information from a single cross section, however, the layer is constructed as a linear blend between two consecutive cross sections. A slice taken vertically through this reconstructed layer would produce a trapezoid. Thus, these layers can be considered generalized trapezoidal cylinders. While VCP allows reconstruction25 of vertical-edged parts with very little error, the trapezoidal cylinder paradigm (TCP) additionally allows reconstruction of parts from models generated with ruled surfaces with very little error. Modeling of double curved surfaces by TCP will still produce error, but much less error than by VCP.
This invention alternatively applies an arc cylinder paradigm (ACP), 30 wh~ Icby a variable radius arc is ~lt to the edge of a layer. This curve fit is ec~e.~ lly of second order at the layer edge. Layers produced using ACP can be considered generalized cylinders with concave or convex curved edges. The radiusof curvature will generally vary with position along the edge, possibly transitioning CA 022~0822 1998-10-01 from convex to concave on a single layer. An algo,iLhl-- is required to select the Mdius that will minimi7e the error between the model and the reconstructed layer.
It is within contemplation to utilize paradigms using even higher order curve fits for layer edges. For example, by requiring the surface gradient at the edge of adjoining layers to be equal, a reconstructed part will be characterized by a smooth transition from layer to layer. A higher order version of the FPP would further ~nhmce the reconstruction of curved surfaces.
This invention contemplates the design and implementation of rapid prototyping devices using higher order construction alg~rill~nls (HOCA) for use in 10 rapid prototyping of large scale master models. Examples of pMctical applications include full scale models of automobiles, boat hulls, wind turbine air foils, or molds for use with room temperature layup of composites. Lost foam casting and other conventional casting techniques may be used to convert large polystyrene foam models into metal C~ting.~.
A specific embodiment of this invention utilizes TCP to build prototypes from "trapezoidal disks." TCP creates linear interpolation between the upper andlower cross sections which define one layer or slice of a CAD model being constructed. The height of each trapezoid is equal to the thickness of m~teri~l used to construct the prototype model. By using thick layers, construction time for the 20 overall model is significantly reduced. It is practical, for example, to cut layers from 1.22 meters by 2.44 meters by 2.54 cm (4 ft by 8 ft by 1 inch) thic~
polystyrene foam in~ tif~n boards. Stacking and bonding of the layers may be done m~nl-~lly or by automated systems.

BRIEF DESCRIPIION OF DRAWINGS
In the drawings, which illustrate what is ~;ullcnLly regarded as the best mode for car~ing out the invention:
FIG. 1 is a pictorial view of a machine embodying the invention, with an end plate removed to permit better visibility of components;
FIG. 2 is a fragmentary view of the machine of FIG. 1, illustrating components which manipulate the positions of a sheet of construction matçri~l and a cutter;

CA 022~0822 1998-10-01 FIG. 3 is a fragmentary view of components of a cutting assembly of the m~c~hine of FIG. 1, illustrating alternative orientations of a cutter wire;
FIG. 4 is a flow diagram of the method of this invention;
FIG. S is an illustration of an electronic model of a vase;
S FIG. 6 is a fragmentary illustration of the model of F~G. S decomposed into - electronic layers;
F~GS. 7, 8 and 9 are diagrammatic illustrations of the respective fits with respect to a layer surface offered by VCP, TCP and ACP paradigms in accordance with the invention;
F~G. 10 is a plot of the percent error of surface fit the paradigms of FIGs 7, 8 and 9 as a function of layer tllicknesc;
FIG. 11 is an illustration of an electronic model of an air foil;
FIG. 12 is an illustration of the model of FIG. 11 decomposed into electronic layers; and F~G. 13 is a pictorial view of an assembled machine incorporating the components i]lnstr~tP~ by FIGS. 1, 2 and 3 for operation in accordance with the sorlw~lc; set forth at pages 14 through 117.

BEST MODE FOR CARRYING OUT THE INVENIION
As illustrated by FIG. 1, a machine of this invention, flesign~ted generally 20, may utilize an electronically heated wire 22 (F~GS. 2 and 3) to cut rigid sheets 24. The sheets 24 are manipulated in a forward or reversed direction along a selected travel axis, A--A, atop horizontal drive rollers 26, 28. Above each drive roller is a free floating nip/idler roller 30, 32 to ensure contact between the drive 2~ rollers 26, 28 and the foam sheet 24.
The heated wire 22 is shown by FIG. 2 positioned transverse the sheet 24 approximately vertically. The attitude of the wire 22 with respect to vertical transverse the travel axis A--A may be adjusted as illustrated by FIG. 3, through the relative positioning of a first linear positioning device 36, mounted to travel along a first, lower rail 37 and a second linear positioning device 38, mounted to travel along a second, upper rail 39 approximately parallel the first rail 37. As best shown by F~G. 2, the attitude of the wire 22 with respect to vertical parallel the travel axis A--A is adjustable by means of a third linear motion device 40, mounted CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 to tMvel ap~loxi--la~ely normal the second rail 39. In operation, the linear motion devices 36,38,40 are driven in coordination with the manipulations of the sheet 24 along the axis A--A. Motion control for each linear positioning device 36,38,40,as well as for the drive rollers 26,28 is supplied by stepper motors (not shown), which receive input signals from a software control program set forth at pages 14 through 117.
The combination of these three motion devices 36,38,40 provide the illustrated mechanism 20 three degrees of freedom. The powered drive rollers 26,28 feed the construction sheet 24 into the cutting wire 22, thereby contributing a fourth degree of freedom.
Operation of the illustrated device is similar to the operation of a roll plotter, but with an additional two degrees of freedom in an x-y coordinate system. The drive rollers 26,28 and lower linear motion device 36 act in the fashion of a roll plotter to position the base 42 of the cutting wire anywhere on the bottom surface 44 (FIG.3) of the foam sheet 24. The upper two linear motion devices 38,40 add two more degrees of freedom, allowing the upper end 46 (FIG. 2) of the cutter wire 22 to be positioned independently of the lower end 42.
The ~ e ends 42, 46 of the electrically heated cutting wire 22 are directly attached to two of the three independent linear motion devices 36,38. Acoil spring 48 connects the upper end 46 of the cutting wire 22 to the device 38.
The coil spring 48 accommodates length adjustments required of the wire 22 as it is positioned for making linearly interpolated cuts at an angle from the vertical plane.
Temperature of the wire 22 iS adjusted by varying the electric current applied to it.
The cutting speed is adjusted to minimi7e cutter deflections caused by the construction material, in the illustrated inct~n~e, foam plastic board 24.
The main tasks of the machine control software set forth at pages 14 through 17 are to recogni~e coordinates representing a CAD 3D solid object, and to find a sequ~nr~e of cutter motions to produce the required cross sectional slices. Once an object is created in a CAD system, it can be easily saved in STL format, the file format currently utilized for many RP techniguec. In selecting an Sll~ file format, it should be recogn~zed that the accuracy of an applo~ lated object saved in theSTL file is the maximum accuracy that the prototype machine will be able to produce. The machine uses geometry information saved in the STL ~le, not the CA 022~0822 1998-10-01 g CAD drawing file. The invention applied to files of greater accuracy will produce more accurate prot~ly~es. AlgoliLIIInS that generate cross sections directly from the CAD model are within contemplation.
After reading an STL file, the control software regenerates the object on a 5 computer screen. A user may then determine the most efficient slice direction by rotating, transforming, and scaling the object on screen. The software then slices the object into layers equal to a selected material thickness, and defines straight line segments which replesenL the edges of the object on the cut plane. The end result of this slicing algolilllln is a series of independent cross sections.
For the actual part layers to be cut, it is nececs~ry to define synchronized positionings of the cutter wire 22. The cutter wire 22 must be repositioned overtime, in cooldinalion with movements of a layer 24 of construction material, to produce somewhat di~relenl cross-sectional configurations at the upper 50 and lower 44 surfaces of the layer 24 in a simultaneous coordinated motion. Defining the 15 cutter path involves optimally matching points on the perimeters of the top and bottom surface cross sections of a slice. Cutter paths are generally determined by m~tching each top cross section point with the closest bottom cross section point.
This ~list~nce ~~h~i...i,~;on approach is generally suitable because it can accommodate virtually any shape. This technique can thus generate thick slices with small error, and is suitable for prototyping large objects rapidly.
The defined cutter path corresponds to respective cutting paths on the upper and lower surfaces of a construction sheet 24. The actual hot wire 22 extends beyond the upper 50 and lower 44 surfaces and pivots about points associated with anchor rods 52, 54 displaced significantly above and below those surfaces.
Accordingly, after finding cutter paths, the software c~lcul~tPs the appr~ iate positions of the respective cutter pivot points to trace the proper cutter path on the n~teri~l. Finally, the software converts position coordinates into a string of pulses to drive the stepper motors. A flow chart for the complete algorithm is presented by F~G. 4.
- 30 Ideally, the cutting m~chine should be constructed and arranged to have a pen up function. The machine is then capable of moving the cutter device from point to point without cutting material, thereby avoiding the need for the layout of access paths to loops and return paths to a home position. When a large object is CA 022~0822 1998-10-01 - W O 97/37317 PCTrUS97/05419 built, registration of slices is an important concern. Adding paths and holes for registration can be done by the software following rules defined by the user.
Two main parameters controlling the quality of the cut surface are cutter speed and temperature. Speed is defined by the pulse rate sent to the stepper S motors which is related to the torque of the motors. The cutter te--~peldLule is a function of electric current going through the cutter wire 22. Undesirable combinations of speed and temperature can result in local areas where the cuttermelt radius becomes excessive. Cutting too fast or too cool results in excessivedeflection of the hot wire which also reduces accuracy. Optimal combination of 10 these parameters depends on material pr~ellies and the characteristics of the object geometry, and will generally be determined through careful experiments. It has been observed that m~ ;.inil~ a constant speed and temperature over the working period is beneficial.

EXAMPLE 1.
A simple vase 55 (FIG. 5) was designed to test construction accuracy as a function of layer thicknecs for the construction paMdigms: VCP, TCP, and ACP.
Under the assumption that the speed of construction of a layer is independent oflayer thickne,ss, it follows that parts built with thicker layers will require less time 20 to construct.
The vase shape may be ,t;~r~senled m~them~tically, using a series of two imP~n~ional (x,y) arcs and lines that are revolved about the y axis:

Outer Surface:
Vertical Dimension (y) Equation 0 - 28 (x-3)2+(y-15)2 _ 1 28 - 30 3x + 5y = 164 3~-35 x=3 35 - 36 (x 4)2 + (y 35)2 = 1 36 - 38 (x-6)2 + (y 37)2 = 1 CA 022~0822 1998-10-01 Inner Surface:
Vertical Dimension (y) Equation 0-3 x =0 3 - 28 x2 + (v-15!2 - 1 28 - 30 2x + 3y = 94 30-35 x = 2 35 - 37 (x 4)2 + (y 35)2 = 4 37 - 38 (x 4)2 + (y_38)2 = 1 For this simple shape, as can be seen from FIG. 7, all cross sections are either solid circular cylinders 56 or solid circular annuli 58, and a specific cross section is completely defined by one or two coordinates on the x axis. To apply VCP, an algolilhl.l is needed to select the x coordinates for each layer (one or two numbers). For TCP, each layer requires x coordinates for the upper surface and the lower surface (two or four numbers). ACP requires x coordinates for upper and lower s~ c,es along with one or two radii (three or six numbers). The algo~ s used in this example for each paradigm were:
VCP
The radius of each layer is forced to match the model at the top of each layer.
TCP
The algo~ for TCP utilizes the cross sections generated for VCP. The top cross section for a given layer is identical to the bottom layer of the closest layer above it.
ACP
Arc cylinders are generated from the cross sections generated for VCP. The arc radius is generated by passing an arc through the upper surface point, the lower surface point, and a third point that lies on the model surface at the midpoint of the - 30 layer. Imp4.ment~ion was as follows:
1) identify the x coordinate for a new cross section in the center of the layer.

- WO 97/37317 PCT/US97/0~419 2) define a line segment from the upper surface to the center and a second from the lower surface to the center.
3) The bisecting norrnals of these line segments intersect at the center of curvature, identifying the radius.
The fits of these construction algo,ilhllls are shown schem~tiç~lly in FIGS.
7, 8 and 9, respectively. The accuracy of each algorilh-l, was measured by calculating the error between the volume of m~tçri~l required by the exact model, lc~"tsenLed by the solid line 60, and that required by the reconstructed model, represented by the broken lines 62, 64 and 66, respectively. First, the exact voIume of the m~them~ti~l model for the vase was calculated. Next, the model was decomposed into layers (FIG. 6), and the volume of the combined layers was calculated. This procedure was performed for each algolilhln, varying layer thiçknPss from 0.1 mm to 2 mm. The percent error associated with a given algoliLIIl-- and layer thickness was calculated by:

% Error = ( ~ r~l 100 where V0 is the volume of the mathematical model and Vrc is the volume of the reconstructed model.
The data from these calculations are plotted in FIG. 10. As expected, the error is small for any of the paradigms if the layer tllicknt ss is very small. As 20 layer thickness increases, the accuracy decreases for each method. The error for VCP increases ~ m~tit ~lly faster than the higher order algolilh-l~s, excee~ling 15 percent error as the layer thickness approaches 1 cm. At 1 cm thickness, both higher order techniques perform at under three percent error.

EXAMPLE 2.
A computer generated model of a NASA LS(1)-417MOD wind turbine air foil 70 is shown in FIGS. 11 and 12. Construction of this air foil was all~mpledwith good success using the equipment described in connection with FIGS. 1-4 30 assembled as illustMted by FIG. 13. The foil shape is described by a series of complex spline curves 71, which have a spline taper through the height (h) and CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/05419 width (w). The model is further complicated by a 42~ angle of twist along the foil length (l). The total length of the model is 4.57 meters (15 feet). The initial width (at the base 75) of the air foil is 116.8 centimeters (46 inches), reducing to 25.4 cPntimeters (10 inches) at the tip 77. The height of the air foil starts at 19.84 centimeters (7.81 inches) at the base 75, reducing to 2.8~ centimeters (1.12 inches) at the tip 77.
The cu~ uler model of the air foil was created using Parametric Technology's Pro/FnginPer software. Spline points at various cross sections the air foil were generated from norm~li7ed data developed at NASA. These spline points 10 were subsequently read into Pro/P.n~inP-er and series of spline curves were fit to the points as shown in Fig 12. Smooth spline surfaces 80 were then generated betweenthe spline curves 71. ~ co---puler solid model (Fig. 11) was created from the hollow spline shell. This computer solid model was stored as a standard stereolithography format file. The equipment illustrated by Fig. 13 was used to cut 15 out the 180 layers required to construct the air foil p-utoly~ue, requiring approximately 17 sheets of 1.22 meters by 2.44 meters by 2.54 centimeters (4 feet by 8 feet by 1 inch) thick sheets of bead board foam. Each layer of foam was then m~nu~lly registered and bonded.
The accuracy of this air foil prototype was in the range of 0.08 to 0.6 %
error, when com,lJal~d to chord lengths in the co---pulel model. This level of accuracy is considered acceptable, given the size of the prototype and the facetmesh size of the STL file. The surface finish of the model was fairly rough, because of the STL file approximation of the co...l~ulel model. Further facet 1 ;;rmr.~ nt of the STL file would correspondingly improve the surface finish.
The air foil computer model was created in approximately 2 hours using Pro/PnginPer. Cut out and assembly time for the air foil prototype was estim~ted at 9 hours.
Reference in this disclosure to details of speci~c embodiments is not intended to limit the scope of the appended claims which themselves recite thosedetails regarded as signific~nt to the invention. It is intended for the appended claims to embrace equivalents.
-CA 022~0822 1998-10-01 W O 97/37317 rCT~US97/05419 !**************************#********************************
! Written by Cheol H. Lee ! University of Utah ! File: 72readme.tru ! Date: 12/96 ! Object: General instruction for SM2 control program !**********~************************************************
1. General Process - In CAD, a stl file (*.stl) is made.
- All text in stl are removed and all coords are saved in numeric form in a vertex file (*.vtx) - An object is sliced and lines that represent outlines of each cross section are save in line file (*.ln) - All lines in line file are sorted to make closed loops in counter clockwise direction and saved in a loop file (*.lp) - All lines in loop file are dis~ d into points which are saved in a point file (*.pt) - All loops of top and bottom cross sections of a slice are matched and cutter movements are flet~rmined and saved in a cut file (*.ct) - Cutter movements are converted into number of steps to move machine which are saved in a step file (*.st) - A C program reads step file and generates commands to drive moters 2. Directory Structure - \ : all True Basic program files, *.tru - \bc31\bin~ : rp-mt4.c - \object\ : *.stl, *.vtx, setup.rp - \object\[object_name]\: *.ln, *.lp, *.lpx, *.pt, *.ptx, *.ct, *.ctx *.st, ctreport.txt - \object~temp\ : *.st, ctreport.txt 3. File Structures - A CAD s/w makes *.stl file - A True Basic program makes all other files from *.vtx to *.st - A C program drives machine and is called by a True Basic program - *.stl: stl file. made by CAD s/w. text or binary file.
- * vtx: vertex file or object file. record file.
9 records for each triangle (xl,yl,zl,x2,y2,z2,x3,y3,z3) - *.ln: line file. record file. 4 records for each line (xl,yl,x2,y2) - *.lp: loop file. record file. 4 records for each In (xl,yl,x2,y2) - *.lpx: loop index file. record file. each loop has 10 records (start line num, end line num, xd,yd, xu,yu, xl,yl, xr,yr) xd,yd=ymin pt. xu,yu=ymax pt. xl,yl=xmin pt, xr,yr=xmax pt - *.pt : point file. record file. 2 records for each pt (xl ,yl ) - *.ptx: point index file. record file. each loop has 10 records (start pt num, end pt num, xd,yd,xu,yu,xl,yl,xr,yr) - *.ct: cut file. record file.
4 records for each cutter movement (xb,yb,xt,yt) - *.ctx: cut index file. record file.
13 records for each m~c.hing loop, and 5 rec at the end (start num of cut,end num of cu~,xhst~rt,ybstart, xtstart,ytstart xmin xm~x,ymin,ymax,index_bindex_t,max_angle) ... (Ymin xm~x,ymin,ym~x m~x_angle for all match loops) - *.st: step f!le. text file. 4 numbers for each cutter movement ~xl,x2,yl ,y2) - setup.rp: setup file. record file. ]5 jop setup pdldlll.

- WO 97/37317 PCT/US97/05419 . -(object nqnn~,m-m_tri"lh qngl~,cp~e_t,space b,d_loop,d_point xmax,ymqx 7mqx,xh,yh,decimal,skip) - ctreport.txt: cut report. text file.
16 global paldlll. lel~ and 4 pdlalll~,t~ for each slice (object$,num_tri,-1h qngle cp~q~ce-t~space-b~d loop,d point, xmax,ymax 7mqx xh,yh,decimql c~ip,clice ci7(~ of each slice, max angle of each slice, num of loops of each slice) 4. Program Files - 72readme.tru: general instruetion for SM2 control program - 72-main.tru: main program - 72-menu.tru: prepare menus - 72-1-vtx.tru: *.stl -> *.vtx - 72-2-lnl.tru: *.vtx -> *.ln 72-2-ln2.tru - 72-3-lpl.tru: *.ln -> *.lp 72-3-lp2.tru - 72-4-pt.tru: *.lp -> *.pt - 72-5-ctl.tru: *.pt -> *.ct 72-5-ct2.tru:
- 72-6-st.tru: *.ct-> *.st - rp-mt4.c : *.st -~ step pulse - 72-gvt.tru : graphics for *.vtx - 72-gln.tru : graphics for *.ln, *.lp, and *.pt - 72-gct.tru : graphics for *.ct and *.st - 72-ut.tru : utilities to read index file and eut report file !*************
! End of File !*************

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 !'~*****************************************************************
! Written by Cheol Lee !

! File: 72-ut.tru ! Date: 10/95 !

! Object: display contents of index file and cut report file ! Input: *.lpx, *.ptx, *.ctx, ctreport.txt ! Output: display info on screen !******************************************************************
! MENU
!

! - Cut report is in object\[object name]\ctreport.txt text file (object$,num_tri,-1h :~nglP ~p~ce_t,space_b,d loop,d point, xmax,ymax,7m~x,xh,yh,decimal,skip,slice,size of each slice, max angle of each slice, num of loops of each slice) !******************************************************************
library "utillib.tru"
name$="sink"
start,end= I
call auto_read_ct_index(name$,start,end) !callread cut_report stop num$=" I 9"
call record_to_text_file("temp\"~nl~m5~.".st","temp\"~nllm~R~".txt") end EXTERNAL
!*********
! Surnmary (72-ut) !*********
SUB read_index_file(in_file$) ! SUB auto_read_lp_index(name$,start,end) ! SUB auto_read_pt_index(name$,start,end) SUB read_cut_index file(file_ctx$) ! SUB auto_read_ct_index(name$,start,end) ! SUB cut_report(object$,num_tri,dh,angle,space_t,space_b,d loop,d_point,&
& xmax,ym~x 7m~x xh,yh,decimal,skip,slice,start,end) ! SUB read_cut_report(name$) !******************************
! Su'uluulil.e: read index_file !******************************
SUB read index_file(file_in$) ! i ! Read *.lpx,*.ptx index file and display contents ! file_in$: *.lpx, or *.ptx index record file CALLopen file(#l,file_in$,error) IF error=l THEN exit sub ASK #l :Filesize nurn_record IF num_record=0 THEN
PRINT "No record!! blank record file!"
EXIT SUB
END IF

CA 022~0822 1998-10-01 RESET #l :Begin PRINT "File name: ";file_in$
PRINT "start/end","low(x/y)","high(x/y)","left(x/y)","right(x/y)"
PRINT "
FOR i=l TO num_record/10 READ # I :rl ,r2,r3,r4,r5 ,r6,r7,r8,r9,rl 0 PRINT i;")";rl,r3,r5,r7,r9 PRINT i;")";r2,r4,r6,r8,rlO
PRINT " "
NEXT i CLOSE #l END SUB
!*#*****************************
! Subroutine: auto read_lp_index !****~**************************
SUB auto_read_lp index(name$,start,end) ! i(3) ! display *.lpx file from start.lpx to end.lpx ! name$: object name ! start,end: start and end file number for *.lpx FOR i=start TO end file_in$="object\" & name$ & "\" & str$(i) & ".lpx"
CLEAR
CALL read_index_file(file_in$) GET KEY getkey NEXT i END SUB
!*******************************
! Subroutine: auto_read_pt_index !*****************~*************
SUB auto_read_pt_index(name$,start,end) ! i(3) ! display *.ptx file from start.ptx to end.ptx ! name$: object name ! start,end: start and end file number for *.ptx FOR i=start TO end file_in$="obJect\" & name$ & "\" & str$(i) & ".ptx"
CLEAR
CALL read index_file(file_in$) GET KEY getkey NEXT i END SUB
!******************************
! Subloul-nc: read cut_index_file !******************************
SUB read_cut index_file(file_ctx$) ! i ! Read *.ctx index file and display contents ! file ctx$ : *.ctx index record file CALL open_file(#l,file ctx$,error) IF error=l THEN exit sub ASK #l :Filesize num_record IF num_record=0 THEN
PRINT "No record!! blank record file!"
EXIT SUB
END IF
RESET #l:Begin PRINT "File name: ";fiie_ctx$

CA 022~0822 1998-10-01 PRINT "start/end","start(xb/yb)","start(xt/yt)","xmin/xmax","ymin/ymax"PRINT "index(b/t)","angle","xsize","ysize"
PRrNT " "
FOR i=l TO (num_record-5)/13 READ #1 :rl ,r2,r3,r4,r5,r6,r7,r8,r9,rlO,rl I ,rl2,rl3 PRINT i;")";rl,r3,r5,r7,r9 PRINT i;")";r2,r4,r6,r8,rlO
PRINT
PRINT i;")";rl 1,rl3,r8-r7,rlO-r9 PRINT i;")";rl2 PRINT " "
NEXT i CLOSE #l END SUB
!*******************************
! Subroutine: auto_read ct index !*******************************
SUB auto_read_ct_index(n~ml-~ ct~rt,end) ! i(3) ! display *.ctx file from start.ctx to end.ctx ! name$: object name ! start,end: start and end file number for *.ctx FOR i=start TO end file_in$="object\" & name$ & "\" & str$(i) & ".ctx"
CLEAR
CALL read_cut_index file(file_in$) GET KEY getkey NEXT i END SU~
! ***********
! cut_report !***********
SUB cut_report(object$,num tri,-lh,~ngllo,cpare t,space_b,d loop,d_point,&
& xmax,ym~x,7m~x xh,yh,decimal,skip,slice,start,end) ! all input ! make cut report (ctreport.txt) in object directory ! object$, num_tri: object name. number of triangles ! dh, angle : foam thil~n~sc m~xim~lm cut angle ! space_t, space_b: space bw control point and top or bot surface ! d_loop, d point: min distance bw loops. discrete point distance ! x,y,zmax object size ! xh,yh : home position in x and y direction ! decimal, skip: round decimal. number of skip points.
! slice, start,end: num of slices. start, end num of slice to report ~ullep~ $="object\" & object$ & "\ctreport.txt"
OPEN #S:name cutreport$,access outin, create newold,org text ERASE #5 PRINT #5:"object : ";object$
PRINT #5:"triangles: ";num_tri PRINT #5:"slices : ";slice PRINT #5:"foam. angle : ";dh,angle PRINT #5:"space (t/b) : ";space t,space_b PRINT #S:"loop dis. pt res: ";d_loop,d_point PRINT #5:"skip. decimal : ";skip,decimal PRrNT #5:1'home (xh/yh) : ";xh,yh PRINT #5:"size : ";"x =";xmax;" y =";ymax;" z =";zmax PRINT #S:"
PRINT #5:"slice #"," dx"," dy"," angle"," loops"
PRINT #5:"
count=0 FOR i=start TO end file_ctx$="object\" & object$ & "\" & Str$(i) & ".ctx"
~ OPEN #l:name file_ctx$,access input ASK #l:filesize fsize loops=(fsize-S)/13 RESET # l :record fsize-4 READ #l:xmin,xm~x,ymin,ymax,max_angle PRINT #5:"#";i,xmax-xmin,ymax-ymin,max_angle,loops CLOSE #l cou.,l--cuull~+ 1 IF count>=4 THEN
PRINT #5:" "
count=0 END IF
NEXT i PRINT #S:"
PRINT #5:"end of record"
PRINT "cutreport.txt for ";object$;" is made. "
CLOSE #S
END SUB
!*****************************
! Subroutine: read_cut_report !*****************************
SUB read_cut_report(name$) ! o ! display contents of cut report file ! name$: object name CLEAR
cutreport$="object\" & name$ & "\ctreport.txt"
CALL open_file(#l" U~i pcl~$,error) IF error=l THEN exit sub count=0 DO WHILE MORE # l INPUT #l :text$
PRINT text$
Cuulll--C~)ulll~ I
IF mod(count,24)=0 THEN
get key key CLEAR
END IF
LOOP
CLOSE #l END SUB
!*~**~****~**
! End of File t t t t 1~

CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/05419 !**~ ****~ ***************
! Written by Cheol H.Lee ! File: 71-main.tru ! Date: 6/96 ! RP Shape Maker 2 control program !*******************~****************
! M EM O
! - run ixtsr m: 10000 for small memory. default is 52K
! - *.stl, *.vtx files are in "object\" directory ! - *.ln, *.lp, *.pt, *.lpx, *.ptx files are in "temp\" directory ! - setup.rp is in program directory ! - index hle (*.ptx, *.lpx): num_start,num_end,xd,yd,xu,yu,xl,yl,xr,yr, 10 record for each loop ! - cut file (*.ct): xmin~xm~x~ymin~ymax~max-angle 5 records at the end of file ! PROS
! - maintain status file, and loaded and updated ! - menu driven, ststus list ! - window size and object size are different option.
when change object, window and object size are updated !**********~**************************************
LIBRARY "72-1-vtx.tru"
LIBRARY "72-2-lnl.tru"
LIBRARY "72-2-ln2.tru"
LIBRARY "72-3-lp2.tru"
LIBRARY "72-3-lpl .tru"
LIBRARY "72-4-pt.tru"
LIBRARY "72-5-ct2.tru"
LIBRARY "72-5 -ct 1 .tru "
LIBRARY "72-6-st.tru"
LIBRARY "72-ut.tru"
LIBRARY "72-gvt.tru"
LIBRARY "72-gln.tru"
LIBRARY "72-gct.tru"
LIBRARY "0-menu.tru"
!LIBRARY "72-menu.trc"
LIBRARY "3dlib.trc"
LIBRARY "utillib2.tru"
LIBRARY "utillibl.tru"
LIBRARY "shell.tru"
!LIBRARY "72-l-vtx.trc"
! LIBRARY "72-2-ln 1 .trc "
!LIBRARY "72-2-ln2.trc"
!LIBRARY "72-3-lp2.trc"
!LIBRARY "72-3-lpl.trc"
! LIBRARY "72-4-pt.trc "
! LIBRARY "72-5-ct2 .trc "
!LIBRARY "72-5-ctl .trc"
! LIBRARY "72-6-st.trc "
! LIBRARY "72-ut.trc"
! LIBRARY "72 -gvt.trc "
! LIBRARY "72-gln.trc "
! LIBRARY "72-gct.trc "
!LIBRARY "72-menu.tru"
! LIBRARY "3dlib.trc "
!LIBRARY "utjllib2.trc"
!LIBRARY "utillibl.trc"
!LIBRARY "shell.tru"

CA 02250822 1998-1o-ol W O 97/37317 PCT~US97/05419 DIM a(0,0),b(0,0),index(10,10) xls,x2s,y2s=800 yls=120.63 !num var=26 !*~*~******~***
! Main Program I**~ *********
-SET MODE "vga"
CALL read_setup (name$,num_tri,-1h In~le cra~e_t,space_b,d_loop,d_point,&
& xmax,ym ix 7m:~x,xh,yh,decimal,skip) !

! menu job loop DO
MAT REDIM a(0,0),b(0,0) ! save memory !------! menu rwin=.8 IF xmax*rwin>ymax THEN ! window size xwin=xmax ywin=xmax~rwin ;~Will--~IIId~
ELSE
xwin=ymax/rwin ywin=ymax zwin=zmax END IF
CALL status (name$,num_tri -1h ~n~1e cpaee_t,5pace_b,d_1Oop,d_point,&
& xmax,ym~x 7m~x,xh,yh,decimal,skip) CALL main_menu (job) CLEAR
SET COLOR "white"
!

! main job dcsc,.~lio SELECT CASE job CASE 0 ! quit STOP

CASE I
DO
!exit do ! remove dos shell for memory-----------CLEAR
PRINT "Press (0) to return to main menu."
INPUT PROMPT "DOS command: ":com$
IF com$="0" THEN
EXIT no ELSE

PCT~US97105419 CALL shell(com$) END IF
GET KEY getkey LOOP
!

! job setup CASE 2 ! change job setup DO
!

! setup menu CALL status (name$,num_tri,-1h ~ngle cp~ce_t,space_b,d loop,d point,&
& xmax,ym~Y,7m~,xh,yh~decim~l ckir) CALL setup_menu(job_setup) CLEAR
SET COLOR "white"
SELECT CASE job_setup CASE 0 ! return to main menu EXIT DO

CASE I ! foam thicknl-cc PRINT "current foam thirkn~cc ";dh INPUT PROMPT "Foam thirkn~cc (cm)? ":dh CASE 2 ! max cuKer angle PRINT "current cutter angle: ";angle INPUT PROMPT "Maximum cuKer angle (degree)? ":angle CASE 3 ! bot space PRINT "current boKom space: ";space_b INPUT PROMPT "Bottom space from the foam (cm)? ":space_b CASE 4 ! top space PRlNT "current top space: ";space_t INPUT PROMPT "Top space from the foam (cm)? ":space_t CASE l l ! loop distance PRINT "current loop distance: ";d loop INPUT PROMPT "Minimum distance between loops (cm)? ":d_loop CASE 12 ! point distance PRlNT "current point distance: ";d point INPUT PROMPT "M~xim--m distance between points (cm)? ":d_point CASE 13 ! skip PRINT "current skip points: ";skip INPUT PROMPT "Skip points? ":skip CASE 14 ! decimal PRINT "current rount decimal: ";decimal INPUT PROMPT "Round decimal? ":decimal CA 022~0822 1998-10-01 CASE 21 ! home position PRINT "current home position: ";xh;yh INPUT PROMPT "Home position x,y (cm)? ":xh,yh CASE 31 ! save setup - CALL save_setup(name$,num_tri,~1h ~n~l~,cp~ce_t,5pace_b,d_100p,d point,&
& xmax,ymqx,7.m~x,xh,yh,decimql ~ p) EXIT DO
CASE ELSE
PR~NT "Job is not available. Select again "
GET KEY key EXIT SELECT
END SELECT
LOOP
!

! object CASE 3 ! combine STL files CALL shell("dir/wio:n object\*.stl") PRINT "Press (0,0,0) to cancel."
INPUT PROMPT "stl_inl, stl_in2,0stl_in3? ":inl $,in2$,out$
IF inl$="O" and in2$-"0" and out$="O" THEN EXIT select PRINT "Wait..."
CALL combine stl(in I $,in2$,out$) CASE 4 ! append STL files CALL shell("dir/w/o:n object\*.stl") PRINT "Press (0,0) to cancel."
INPUT PROMPT "stl_inout, stl_in.":inout$,in$
IF inout$="O" and in$-"O" THEN EXIT select PRINT "Wait..."
CALL append_stl(inout$,in$) CASE 5 ! stl to object CALL shell("dir/w/o:n object\*.stl") PRINT "Press (O) to cancel."
INPUT PROMPT "Object name? ":name$
IF name$="O" THEN exit select com$="md object~" & name$
CALL shell(com$) CLEAR
CALL stl to vtx(name$,num_tri,xmax,ymqx ~m ~x) CLEAR
CALL draw vtx 3d(name$,xmax,ym~x 7m:1x) GET KEY key CASE 6 ! select object CALL shell("dir/w/o:n object\*.vtx") temp$ name$
PRINT "Press (O) to cancel."
INPUT PROMPT "Object name? ":name$
IF name$="O" THEN
name$=temp$
exit select END IF

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 CALL object_size(name$,xmin ~m ix~ymin~ym~7mln~7m~nnnl tri) CASE 7 ! rotate object PRINT "Press (0,0,0) to cancel."
PRINT "Current object is ";name$
PRINT
INPUT PROMPT "Rotated object name, axes, angle? ":name_out$,rot_axes$,rot_angle IF rot_angle=0 THEN exit select CALL rotate_vtx(name$,rot_axes$,rot ~n~le,~m~x,ym~x 7m~x,name out$) name$=name_out$
CLEAR
CALL draw_vtx_3d(name$,xmax,ymA~ 7m~x) GET KEY key CASE 8 ! resize object PRrNT "Press (0,0,0,0) to cancel."
PRINT "To convert INCH into CM, scale=2.54."
PPINT "Current object is ";name$
PRINT
INPUT PROMPT "Scaled object name, ratio~x,y,z)? '':name_out$,xr,yr,zr IF xr=l and yr=l and zr 1 THEN exit select IF xr=0 and yr=0 and zr=0 THEN exit select CALL scale vtx_file(nom~$"~r,yr,zr,xmax~ym~x 7m~x,n~ml~_out$) name$=name_out$
CASE 9 ! registration INPUT PROMPT "Start, end file number?: ":start,end CLEAR
CALL registration(name$,start,end,xwin,ywin) !---! a slice CASE 11 ! object to one line PRINT "Press (0,0) to cancel."
PRrNT "object height:";zmax;", foam thickness:";dh;", number of line file:";int(zmax/dh)+l INPUT PROMPT "Line file number, cut height? ":file_ln,slice_h IF file_ln=0 and slice_h=0 THEN exit select CALL vtx_to_line_h(n~m~$ clire-h~erim~l file_1n) CLEAR
CALL draw_line(n~m~$,file 1n,0,xmax,ymax) GET KEY getkey CASE 12 ! object to lines PRINT "Press (0,0) to cancel."
PRINT "object height: ";zmax;", foam thicknecc ";dh;", number of line hle: " ;int(zmax/dh)+ I
INPUT PROMPT "start, end line files? ":start,end IF start=0 THEN Exit select CALL vtx_to_line(name$,start,end,dh,decimal) GET KEY getkey CASE 13 ! lines to loops PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of loop file:":int(zmax/dh)+ I

CA 022~0822 1998-10-01 INPUT PROMPT "start, end loop files? ":start,end IF end=0 THEN exit select CALL line_to_loop(name$,start,end,d_1oop) GET KEY getkey CASE 14 ! loop to point PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thi-~kn~ ";dh;", number of point file:";int(zmax/dh)+l ~NPUT PROMPT "start, end point files? ":start,end - IF end=0 THEN exit select CALL loop_to_point(n~m~$,~t~rt,end,d~oint,decimal, I ) GET KEY key CASE 15 ! point to cut PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thirknecc:";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "start, end cut files? ":start,end IF start=0 and end=0 THEN exit select reverse=0 INPUT PROMPT "reverse(0/1)? ":reverse CALL auto_cut(name$,start,end,reverse,dh,angle,decimal,skip) GET KEY getkey CASE 16 ! cuts to steps PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thicl~n~c ";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "start, end step files? ":start,end IF start=0 and end-0 THEN exit select INPUT PROMPT "number of holes(0-n)? ":num hole CALL auto_step(n~m.o$ ct~rt,end,num hole,dh,space_b,space_t,&
& d point,skip,xh,yh,x I s,x2s,y I s,y2s) GET KEY getkey CASE 21 ! remove loop PRINT "Press (0) to cancel."
PRINT "object heiPht:";zmax;", foam thickness:";dh;", number of loop file:":int(zmax/dh)+l INPUT PROMPT "loop file number? ":file_lp IF file_lp=0 THEN exit select CLEAR
CALL draw_auto loop_2d(name$,file_1p,fi1e_1p,0,xwin,ywin) SET COLOR "yellow"
PR~NT
PRINT " Press (0) to cancel."
INPUT PROMPT " loop number to be removed? ":Ip_num IF Ip_num=0 THEN exit select CALL remove_loop(name$,file_1p,1p_num) CLEAR
CALL draw_auto_loop_2d(name$,file_1p,file_1p,0,xwin,ywin) - CASE 22 ! reverse loop PR~T "Press (0) to cancel."
PRINT "object hei~ht:";zmax;", foam thickness:";dh;", number of loop file:";int(zmax/dh)~ I
INPUT PROMPT "loop file number? ":file_lp IF file lp=0 THEN exit select CLEAR

CA 022~0822 1998-10-01 CALL draw_auto loop_2d(name$,file_1p,file_1p,0,xwin,ywin SET COLOR "yellow"
PRINT "Press (0) to cancel."
INPUT PROMPT "loop number to be reversed? ":lp_num IF Ip_num=0 THEN exit select CALL reverse loop(name$,file Ip,lp_num) CLEAR
CALL draw_auto loop_2d(name$,file_1p,file_1p,0,xwin,ywin) CASE 23 ! point to cut (SMl) PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thicknP~ ";dh;", number of cut file:";int(zmax/dh) lNPUT PROMPT "start, end cut files? ":start,end IF start=0 and end=0 THEN exit select CALL auto_cut_sm I (name$,start,end,decimal) GET KEY getkey !------! Read CASE 41 ! read loop index file PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";&;", number of loop file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL auto read_lp_index(name$,start,end) CASE 42 ! read point index file PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thi~-kn~cc:";&;", number of point file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL auto_read_pt index(name$,start,end) CASE 43 ! read ct index file PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of point file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL auto read ct index(name$,start,end) CASE 44 ! read coord file PRINT "Press (0) to cancel."
PRINT "object height:";zmax;", foam thickness:";&;", number of line file:";int(zmax/dh)tl INPUT PROMPT "Coordinate file name? ":file_name$
IF file_name$="0" THEN exit select file_name$="object\" & name$ & "\" & file_name$
CALL read_record_file(file name$,4) GET KEY getkey CASE 4S ! cut report PRINT "Press (0,0) ~o cancel."
PRINT "object height:";zmax;", foam thickness:":dh;", number of cut file:";int(zmax/dh) WO 97/37317 PCT/US97/05419 . -INPUT PROMPT "File number start, end? ":start,end slice=int(zmax/dh) CALL cut report(name$,num_tri,r~h,qn~lP,sp~q~e_t,space b,d_loop,d point,&
& xmax,ymqx,7m~x,xh,yh,decimal,skip,slice,ctqrt,end) CASE 46 ! read report CALL read cut_report(name$) PRINT
INPUT PROMPT "print? (l/0)'7 ":temp - PRINT
IF temp=l THEN
com$="print object\" & name$ & "\ctreport.txt"
CALL shell(com$) END IF
!

! automatic view CASE 51 ! view object - wire CLEAR
CALL draw_vtx_3d(name$,xmax,ym~x 7mqx) GET KEY getkey CASE 52 ! view lines 3D
PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of line file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select h bot=(start-l)*dh h_top=(end- 1 )*dh CLEAR
CALL draw_auto_line_3d(name$,h bot,h_top,dh,xmax,ymax,zmax) GET KEY getkey CASE 53 ! view lines 2D
PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foarm thickness:";dh;", number of line file:";int(zmaxldh)~l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CLEAR
CALL draw_auto line_2d(name$,start,end,0,xwin,ywin) CASE 54 ! view loops PRlNT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thirkness:";dh;"~ wmber of loop file:";int(zmax/dh)+l rNPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CLEAR
CALL draw_auto loop 2d(nqrnp~7stqrt~end~o~xwin~ywin) CASE 55 ! view points - PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;"~ number of point file:";int(zmax/dh)+]
INPUT PROMPT "start, end number? ":start,end - IF start=0 and end=0 THEN exit select CLFAR
CALL draw_auto_point_2d(name$,start,end,0,xwin,ywin) WO 97/37317 PCT/US97/05419 . -CASE 56 ! view cuts -28-PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickn~-~c:'';dh;'', number of cut file:";int(zmax/dh) INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL draw_auto_cut 2d(name$,start,end,dh,xwin,ywin) CASE 57 ! view steps PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of step file:";int(zmax/dh) INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select FOR i=start TO end CLEAR
CALLdraw_st 3d(name$,i,dh,space_b,space_t,xwin,ywin,xls,x2s,yls,y2s,xh,yh) GET KEY getkey NEXT i CASE 91 ! prepare com$="copy object\" & name$ & "\*.st object\temp"
CALL sheli(com$) com$="copy object\" & name$ & "\*.txt obJect\temp"
CALL shell(com$) CASE 92 ! read report CALL read_cut_report("temp") GET KEY getkey CASE 100 ! prototype CALL shell("c:\-clee\bc31\bin\rp-mt4") CASE ELSE
PRINT "Job is not available. Select again "
GET KEY key EXIT SELECT
END SELECT
LOOP
END
! *************
! End of file ! ****~ *~

CA 022'70822 1998-10-01 !*********************************************~7~7**
! Written by Cheol H. Lee !! File: 71-menu.tru ! Date: 6/96 ! Library file for menu !*************************************************
set mode "vga"
clear a=l if a=l then call main_menu (job) else call setup_menu(job) end if end EXTERNAL
!*********
! Summary (71-menu) !*********
! SUB status (name$,num_tri,dh,angle,space_t,space_b,d loop,d_point,&
& xmax,ymax,zmax,xh,yh,decimal,skip) ! SUB main_menu(job) ! SUB setup_menu(job) ! SUBread_setup(name$,num tri,dh7angle,space_t,space_b,d loop,d_point,&
& xmax,yma~;7.m~x xh,yh,decimal,skip) ! SUB save_setup(n~nn~$,n~ tri,dh,angle,space_t,space_b,d_100p,d~0int,&
& xmax,ymax 7m~x,xh,yh,decimal,skip) !*************************
! Subl~uli-lc: status !*************************
SUB status (n~m~$,nlnn_tri,-1h In~ ,cp~e_t,space_b,d_loop,d point,&
& xmax,ym~x 7m~x xh,yh,decimal,skip) ASK free memory mem memory=round(mem/ 1000,1 ) IF dh<>O THEN num_slice=int(zmax/dh) OPEN #9:SCREEN 0.66,1,0,1 WINDOW #9 CLEAR
SET COLOR "white"
SET COLOR "red"
PRINT "JOB SETUP "
PRINT "*********************************"
PRINT " Object ";name$;",";num_tri;"tri"
PRINT" "
PRINT " Slices :";num_slice;"slices"
PRINT " Free memory :";memory;"Kb"
PRINT
PR~NT " Loop gab :";d loop;"cm"

CA 022~0822 1998-10-01 PRINT " Point res :";dQoint;"em"
PRINT " Point skip :";skip;"pts"
PRINT " Decimal :";deeimal;"plaee"
PRINT
PRINT " Cut angle :";angle;"degree"
PRINT " Foam :";dh;"cm"
PRINT " Bottom spaee:";space_b;"cm"
PRINT " Top space :";space_t;"em"
PRINT
PRINT " home x,y :";xh;yh PRINT
PRINT " object x:";xmax;"em"
PRINT" y:";ymax;"em"
PRINT" z:";zmax;"em"
END SUB
!***********************
! Subroutine: main_menu l***********************
SUB main_menu (.job) ! main menu for job selection SET BACK "blaek"
SET COLOR "white"
OPEN #l:SCREEN 0,0.33,0.1,1 OPEN #2:SCREEN 0.33,0.66,0.1,1 OPEN #3:SCREEN 0,1,0,0.1 !-- Istcolumn 11111111111111111111111111111111111111111111111 WINDOW #l CLEAR
SET COLOR "white"
SET COLOR "yellow"
PRINT "RP CONTROL SOFTWARE R72"
PRINT "by Cheol Lee "
PRINT
SET COLOR "red"
PRINT "JOB LIST"
PRINT "******************************"
SET COLOR "white"
PRINT " 0) Quit"
PRINT " I ) DOS"
PRINT " 2) Job setup"
PRINT " 3) Combine STL"
PRINT " 4) Append STL"
PRINT " 5) STL to object"
PRINT " 6) Select object"
PRINT " 7) Rotate object"
PRINT " 8) Resize object"

PRINT " 9) Registration"
SET COLOR "green"
PRINT "SLICE "
SET COLOR "white"
PRINT " 11~ Object to a line "
PRINT " 12) Object to lines "
PRINT " 13) Lmes to loops "
PRINT " 14) Loops to points "
PRINT " 15) Points to cuts"
PRINT " 16) Cuts to steps"
PRINT
PRINT " 21 ) Remove loop "
PRINT " 22) Reverse loop "
PRINT " 23) Points to cuts(SMI) "
!-- 2nd column ~?~ ?~7~ ?~7~ ??~ ?7~?~
WINDOW #2 CLEAR
SET COLOR "white"
SET COLOR "magenta"
PRINT " Manufacturing Lab "
PRINT " Univ. of Utah "
PRINT" "
BOX LINES 0~0.8,0.93,1 PRINT
SET COLOR "green"
PRINT"READ "
SET COLOR "white"
PRINT " 41) Loop index"
PRINT " 42) Point index"
PRINT " 43) Cut index"
PRINT " 44) Coord file"
PRINT " 45) Create cut report"
PRINT " 46) Read cut report"
SET COLOR "green"
PRINT "AUTOMATIC VIEW"
SET COLOR "white"
PRINT " 51 ) Object"
PRINT " 52) Lines-3D"
PRINT " 53) Lines-2D"
PRINT " 54) Loops"
PRINT " 55) Points"
PRINT " 56) Cuts"
PRINT " 57) Steps"
SET COLOR "green"
PRINT "SHAPE MAKER 2"
SET COLOR "white"
PRINT " 91) prepare "
PRINT " 92) check report"
PRINT " 100) prototype"
!-- question window WINDOW #3 CLEAR
SET COLOR "white"
SET COLOR "white"
INPUT PROMPT "Select a job: ":job CLEAR
END SUB
!*************************
! Subroutine: setup_menu !*************************
SUB setup_menu(job) SET BACK "black"
OPEN #I:SCREEN 0,0.33,0.1,1 OPEN #2:SCREEN 0.33,0.66,0.1,1 OPEN #3:SCREEN 0,1,0,0.1 !-- Istcolumn 111111111111111111111111111111111111111111111 WINDOW #l CLEAR
SET COLOR "yellow"
PRINT "RP CONTROL SOFTWARE R67"
PRINT "by Cheol Lee "
PRINT
SET COLOR "red"
PRINT "JOB LIST"
PRINT "******************************~
SET COLOR "white"
PRINT " 0) Return to main menu"
PRINT
PRINT " I) Foam thickness"
PRINT " 2) Max Cut angle "
PRINT " 3) Bottom space "
PRINT " 4) Top space "
PRINT
PRINT " I l ) Min loop gab "
PRINT " 12) Point resolution"
PRINT " 13) Skip points "
PRINT " 14) Decimal point "
PRINT
PRINT " 21) Home"
PRINT
PRINT " 31) Save setup"
!-- 2nd column 7~777777777777?777777~777777777~7?7~?77777~77777 WINDOW ff2 CLEAR

CA 022~0822 1998-10-01 SETCOLOR "magenta" 3 PRINT " M Inllf~ctllring Lab "
PRINT " Univ. of Utah "
PRINT " "
BOX LINES 0,0.8,0.93,1 SET COLOR "white"
!-- question window WINDOW #3 CLEA~
SET COLOR "white"
INPUT PROMPT "Select a job: ":job CLEAR
END SUB
!************************
! Subroutine: read_setup !****#*******************
SUB read_setup (name$,num tri,-lh ~nel~ space_t,space b,d_loop,d pomt,&
& xmax,ymax,zmax,xh,yh,decimal,skip) OPEN # I :name "object\setup.rrn",create newold,access outin, org record RESET #l :Begin WHEN error IN
READ #1 :name$,num_tri,dh,angle,space_t,space_b,d_1Oop~d_point READ #] :xmax,ym~x 7.m~x READ #I:xh,yh,decimal,skip USE
exit sub END WHEN
CLOSE #l END SUB
!************************
! Subroutine: save_setup !************************
SUB save_setup(name$,num tri,dh,angle,space_t,space_b,d loop,d point,~
& xmax,ym~x,7m~x,xh,yh,decimal,skip) OPEN #l:name "object\setup.rp",create newold,access outin, org record ERASE #l SET#I:RECSIZE 10 RESET ~1 :Begin WRITE # I :name5 .num_tri,dh,angle,space_t,space_b,d_loop,d_point WRITE # I :xmax,ymax,zmax WRITE #I:xh,yh~decimal,skip END SUB
!*************
! End of File !*************

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 .-!***********************************************************
! Written by Cheol H. Lee ! University of Utah ! File: 72-1-vtx.tru ! Date: 6/96 ! Object: make object vertex file by reading a stl file ! Input: *.stl file ! Output: *.vtx file !***********************************************************
! M E M O
! - *.stl and *.vtx are in "object\" directory ! - All other files are in "object\[name]\" directory ! - *.stl is a text or a binary file made by a CAD s/w ! - *.vtx is a record file having coord of triangles.
Each triangle has 9 coord (xl,yl,zl,x2,y2,z2,x3,y3,z3) The min x,y,z in *.vtx are always 0 by shifting coord !***********************************************************
library "71-gvt.tru"
library "3dlib.trc"
library "71-ut.tru"
library "utillib.tru"
name$="temp"
! name$="head"
!callget vtx(name$,num_tri) SUB object_size(name$,xmin xmqx,ymin,ymax 7.min 7mqx nnm_tri~
SUB shift_vtx_file(name$,xmin,ymin ,7.min) !call stl_to_vtx(name$.num_tri,xmax,ymqx 7mqx) !call scale_vtx_file("sl".2,83,76,50,"temp") !call combine_stl("dl".0,3~
call rotate_vtx(name$,"x",90,xmax,ym~x,7mqx,"temp") !call object size("temp"1xmin,xmqx,ymin,ymqx 7min ~mAx,num tri) pnnt xmm,xmax print ymin,ymax print 7,min,7.m~x !call rotate_vtx(name$,"z",90,xmax,ymax,zmax) !call draw_vtx_3d(nqm~$ xmqx ymqx 7mqx) end EXTERNAL
!*********
! Summary (72-1-vtx) !***~*****
! SUB combine_stl(name_inl$,name_in2$,name_out$) ! SUB append stl(name_inout$!name_in$) SUB vtx_to_coord(vtx$,#2) SUB text to_coord(text$,rec_num,#2) SUB get_vtx(name5.num_tri) SUB object_size(name$,xmin;xmqx,ymin,ym~x 7min 7mqx,nnm_tri) SUB shift vtx_file(nqmf ~ xmin ymin 7min) ! SUB stl_to_vtx(name5,num_tri,xmax,ym~x 7mqx) ! SUB scale_vtx file(rlame_in$~xr~yr~zr~xmax~ymS~x~7mqx~nqm~_0ut$) CA 022~0822 1998-10-01 ! SUB rotate_vtx(name_in$,axes$,angle,xmax,ym~x 7m~x,name out$) !************************
! Subroutine: combine_stl !************************
SUB combine stl(name_inl$,name_in2$,name_out$) ! i,i,O
- ! Merge two STL files. Useful for SilverScreen stl files ! name_in I $+name_in2$=name_outS
inl$="object\" & name_inl$ & ".stl" ! input file name in2$="object\" & name_in2$ & ".stl"
out$="object\" & name_out$ & ".stl" ! output file name OPEN #I:Name inl$,Access input,Create old,Org byte OPEN #2:Name in2$,Access input,Create old,Org byte OPEN #5:Name out$,Access outin,Create newold,Org byte ERASE #5 DO WHILE More #1 ! copy contents of first STL file READ ~t I ,bytes 1 000:rec$
WRITE #5:rec$
LOOP
DO WHILE More #2 ! append contents of second STL file READ #2,bytes 1000:rec$
WRITE #5:rec$
LOOP
CLOSE #l CLOSE #2 CLOSE #5 END SUB
!**#*********************
! Subroutine: append stl !************************
SUB append_stl(name_inout$,name in$) ! i/o,i ! Append STL files. useful for SilverScreen stl files ! inout$+in$=inout$
inout$="object\" & name_inout$ & ".stl" ! file names in$="object\" & name_in$ & ".stl"
OPEN # I :Name inout$,Access outin,Create newold,Org byte OPEN #2:Name in$,Access input,Create old,Org byte RESET # 1 :End DO WHILE More #2 ! append second file to first file READ #2,bytes 1 000:rec$
WRITE #I:rec$
LOOP
CLOSE #l CLOSE #2 END SUB

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 --!**************************
! Subroutine: vtx_to_coord !**************************
SUB vtx_to coord(vtx$,#2) ! i,o ! Get x, y, z coordinates out of "vertex x y z " text in stl file ! vtx$: "vertex x y z" text in stl file ! #2 : *.vtx file channel valid$="1234567890-+.e" ! valid char for coord length=Len(vtx$) xl=CPos(vtx$,valid$, I ) ! start and end positions of x, y, z x2=NCPos(vtx$,valid$,xl+1)-1 y I =CPos(vtx$,valid$,x2+ 1 ) y2=NCPos(vtx$,valid$ ,y I + 1)- I
z I =CPos(vtx$,valid$,y2+ 1 ) z2=NCPos(vtx$,valid$,z 1 + 1)-1 x$=vtx$[xl :x2] ! x,y,z string y$=vtx$lyl :y2]
z$=vtx$[z I :z2]
x=Val(x$) ! x,y,z coord y=Val(y$) z=Val(z$) WRITE #2:x,y,z ! save three vertex coords END SUB
!******~********************
! Subroutine: text_to_coord !***************************
SUB text to_coord(text$,rec_num,#2) ! i,o,o ! Get x, y, z coordinates from text$ of stl ! text$: one reading text of stl ! rec_num: last record number in text$
! #2 : *.vtx, output record file channel rec_num= I ! initialize DO
outer=Pos(text$,"outer",rec_num) ! pos of start of a triangle endloop=Pos(text$,"endloop",outer) ! pos of end of a triangle IF outer 0 OR endloop=0 THEN Exit Sub triangle$=text$[outer:endloop+6] ! string for one triangle rec_num=endloop+6 length=Len(triangle$) vl=Pos(triangle$,"vertex",1) ! lstvertex v2=Pos(triangle$, "vertex",v l +6) ! 2nd vertex v3=Pos(triangle$,"vertex",v2+6) ! 3rd vertex vl$=triangle$[vl+6:v2-1 ]
v2$=triangle$[v2+6:v3- 1 ]
v3$=triangle$[v3+6:1ength]
CALL vtx to coord( v 1$,#2) ! get x,y,z CALL vtx_to_coord(v2$,#2) CALL vtx_to_coord(v3$,#2) LOOP
END SUB

CA 022~0822 1998-10-01 - W O 97/37317 PCTnJS9710S419 !************************
! Subroutine: get_vtx !************************
SUB get_vtx(name$,num_tri) ! i/o,o ! Make *.vtx file from *.stl file - ! name$: STL and vertex file name without ext~nciQn ! num tri: number of triangles file_stl$="object\" & name$ & ".stl" ! file names file_vtx$="object\" & name$ & ".vtx"
OPEN # I :name file_stl$,org byte ASK #l :filesize fsize ! get number of chars in STL file OPEN #2:name file_vtx$,access outin,create newold, org record ERASE #2 SET#2:recsize 10 rec~os=l! start from beginning of STL file count 0! number of iteration in DO LOOP
DO WHILE more #l count=count+ I! update number of iteration SET # I :record rec_pos ! read from next record READ ~I,bytes 30000:text$ ! read 30000 chars at a time text$=Lcase$(text$) ! make all string lower case CALL text_to_coord(text$,rec_num,#2) ! find vertex coords rec pos=rec pos+rec_num ! update position of record.
LOOP
ASK #2:filesize num_rec num tri=num_rec/9 ! calculate number of triangles CLOSE #l CLOSE #2 END SUB
!*************************
! Subroutine: object size !*************************
SUB ob~ect size(name$ xmin xm~x,ymin,ymax 7min 7m~x,n~lm_tri) ! i,o,..
! Find object size reading vertex coord record file ! name$: vertex file name ! x,y,7min~m~x: min and max of x, y, and z. object size.
! num_tri: number of triangles file_vtx$="object\" & name$ & ".vtx" ! file_name CALL open file(#l,file vtx$,error) ! open record file IF error= I l HEN exit sub ASK #I:filesize num_rec num tri=num rec/9 ! number of triangles and vertexes.
num vtx num rec/3 RESET #l:Begin xmin,ymin7min=1000 ! initializemin7maxofx,y,z xmax7ym~x~7m:lx=- 1 000 FOR i=l TO num_vtx ! compare all x7y7z to find min and max READ iY I :x7y7z IF x~xmin THEN xmin=x ! update min,max value IF x>xmax THEN xmax=x IF y<ymin THEN ymin=y CA 022~0822 1998-10-01 IF y>ymax THEN ymax=y IF Zczmin THEN zmin- z IF z>zmax THEN zmax=z NEXT i CLOSE #l END SUB
!***************************
! Subroutine shift_vtx_file !~*t~**~*~******************
SUB shift vtx_file(name$,xmin,ymin 7min) ! i/o,i,i,i ! Shift coords of vtx file to make xmin,ymin 7min=O
! name$ object name, name$ vtx ! xmin, ymin, zmin min and max of z, y, z original object size file_vtx$="object\" & name$ & " vtx" ! file name OPEN #I Name file_vtx$,Access Outin,Create Newold,Org Record ASK #I filesize num_rec num vtx=num_rec/3 ! number of vertexes RESET #I Begin FOR i=l TO num_vtx ! shift all coords RESET#I Record(i-1)*3+l READ # I x,y,z RESET #l Record (i-1)*3+1 WRITE #l x-xmin,y-ymin,z-zmin NEXT i CLOSE #1 END SUB
!***************************
! Subroutine stl_to_vtx !***************************
SUB stl_to_vtx(name5,nurn_tri,xmax,ym~x 7m~x) ! i/o,o,o,o,o ! Make * vtx coord file reading and shifting * stl file ! name$ * stl, * vtx object name ! num tri,x,y,zmax num of triangle in vertex file, and object size ! make vertex record file CALL get_vtx(nameS,num_tri) ! find object size CALL object_size(name$~xmin xm lx,ymin,ym~x,7min 7m~x nllm_tri) ! if min=O, then skip shifting IF xmin=O and ymin=O and zmin=O THEN
EXIT SUB
ELSE ! if min<>O, then shift CALL shift_vtx_file(name$,xmin,ymin 7min) a~-xlllax-xmin ymaxymax-ymin ;~...a~ ...ax-zmin END IF
END SUB
!~t~*~*********************
!sùb-uul~-e~ scale_vtx_file !***************************
SUB scale_vtx_file(name_in$,xr,yr,zr,xmax,ymax;7m~x;n~m~_0ut$) ! i,i i,i,i/o,i/o,i/o,o ! Enlarge object by scaling vertex coords CA 022~0822 1998-10-01 ! name_in$? out$: original vertex coord file and scaled vertex file ! xr,yr,zr: conversion ratio. old_coord*ratio=new_coord ! x,y,zmax: new object size after scaling file_old$="object\" & name in$ & " vtx" ! file names file new$="object\" & name_out$ &".vtx"
OPEN #I:Name file_old$,Access Outin,Create Newold,Org Record IF file old$<>file_new$ THEN
OPEN #2:Name file new$,Access Outin,Create Newold,Org Record ERASE #2 SET #2:Recsize 10 END IF
RESET #l :Begin ASK #l:filesize num_rec num vtx=num rec/3 ! get number of vertex FOR i=l TO num_vtx ! scale all vertex RESET # I :Record (i- 1)*3+1 READ #I:x,y,z x=x*xr ! scale x,y,z y=y*yr z=z*zr IF file_old$<>file_new$ THEN
WRITE #2:x,y,z ELSE
RESET #I:Record (i-1)*3+1 WRITE #I:x,y,z END IF
NEXT i xmax=xmax*xr ! update object size ymax=ymax*yr zma~ a~
CLOSE #l IF file_old$<>file_new$ THEN
CLOSE #2 END IF
END SUB
!************************
! Subroutine: rotate_vtx !**~*********************
SUB rotate_vtx(name_in$,axes$,angle,xmax,ym:~x,7.m~x,name_out$) ! i/o,i,i,o,o,o,o ! Rotate vertex file about x, y, or z axes.
! name in$, _out$: *.vtx. object name ! axes$: rotation axes. "x", "y" or "z"
! angle: rotation angle in degree.
! xmax,ymax, zmax: new object size after rotation IF axes$~"x" and axes$~>"y" and axes$~"z" THEN Exit Sub IF angle=0 THEN Exit Sub file_old$="object\" & name_in$ & ".vtx" ! file names file_new$="object\" & name_out$ &".vtx"
OPEN #l :Name file_old$,Access Outin,Create Newold,Org Record IF file old$<>file_new$ THEN
OPEN #2:Name file_new$,Access Outin,Create Newold,Org Record ERASE #2 CA 02250822 l998-lO-Ol - W O 97/37317 PCT~US97/05419 .-SET#2:Recsize 10 END IF
ASK # I :filesize num_rec num vtx=num_rec/3 angle=angle*pi/180 ! convert degree into radian FOR i=l TO num_vtx ! rotate vtx RESET #1 :3~ecord i*3-2 READ #I:x,y,z IF axes$="x" THEN ! rotate about x xnew=x ynew=y*cos(angle)-z*sin(angle) znew=y*sin(angle)+z*cos(angle) ELSE IF axes$="y" THEN ! rotate about y xnew=x*cos(angle~+z*sin(angle) ynew=y znew=-x*sin(angle)+z*cos(angle) ELSE ! rotate about z xnew=x*cos(angle)-y*sin(angle) ynew=x*sin(angle)+y*cos(angle) znew=z END IF
IF file_old$<>file new$ THEN
WRITE #2:xnew,ynew,znew ELSE
RESET #1 :Record (i- 1)*3+1 WRITE #I:xnew,ynew,znew END IF
NEXT i CLOSE #l IF file_old$c>file_new$ THEN
CLOSE #2 END IF
! new object size CALL object_size(name_out$,xmin,xmax,ymin,ymax zmin 7.m~x,num_tri) CALL shift_vtx_file(name_out$,xmin,ymin 7min) ! shift to make min 0 xmax=xmax-xmin ! find new object size ymax=ymax-ymin Gllla~ la~-zmin END SUB
!*************
! End of File ~*************

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 !**************************************************~**************
! Written by Cheol H. Lee ! Untversity of Utah !

! File: 72-2-lnl.tru ! Datc: 6196 !
! Object: slice an object (*.vtx), and make slice files (*.ln) ! Input: *.vtx file ! Output: *.ln file !*****************************************************************
! MEMO
! - *.ln files are in "object\lname~\" directory In *.ln are line coords. Each line has 4 coords (xl,yl,x2,y2) !*****************************************************************
library "69-ut"
library "69-gln"
name$="s I "
start=l end=2 dh,decimal=2 !call vtx_to_line(name$,start,end,dh,decimal) call draw_line(name$,2,0,100,100) end EXTERNAL
!*~*******
! Summary (72-2-ln 1 ) !*********
SUB get line(name$,#1,array,a(,),num tri,slice_h,decimal,file_ln,num_ln) ! SUB vtx_to_line h(n~me$~ ce-h~decim~l file_ln) ! SUB vtx_to_line(name$,start,en~1 ~h dl~cirnal) !**********************
! Subroutine: get_line !**********************
SUB get line(name$,#1,array,a(,),num_tri,slice_h,decimal,file_1n,nurn_1n) ! Make line segment coord record file (*.ln) of a slice i,..,o,o of the object at a certain height ! name$: object name. *.vtx ! #l : *.vtx file channel ! array: array option.
l=use array to load vtx file, 0=do not use array If memory allows, use array ! a(,): load vtx file to array.
array size=a(num_tri,9). (xl,yl,zl,x2,y2,z2,x3,y3,z3) ! num tri: number of triangle in vertex file ! slice_h: height of a slice ! decimal: round decirnal of line coord ! file_ln: line coord record file name. make file_ln.ln in *.ln file (xl,yl,x2,y2)(x2,y2,x3,y3)..
! num_ln: number of lines in *.ln file file_ln$="object\" & name$ & "\" & str$(file_1n) & ".In" ! file name OPEN #2:Name file_ln$,Access Outin,Create Newold,Org Record ERASE #2 SET #2:R~CSIZE 10 CA 022~0822 1998-10-01 - W O97/37317 PCT~US97/05419 RESET #l :Begin ! read *.vtx file and find line segment on a slice FOR i=l TO num tri IF array= I THEN ! use array if there is enough memory xl=a(i,l) ! read triangle coord from array yl=a(i,2) zl=a(i,3) x2=a(i,4) y2=a(i,5) z2=a(i,6) x3=a(i,7) y3=a(i,8) z3=a(i,9) ELSE ! if we don't use array, read file directly READ #I:xl,yl,zl.x2,y2,z2,x3,y3,z3 END IF
zl=zl-slice_h ! shift slice height to z=0 z2=z2-slice_h z3=z3-slice_h found=0 ! found= I if side of triangle intersects slice plane, check= I ! check intl rsection of triangle and slice plane IF z1>0 AND z2>0 AND z3>0 THEN check=0 ! three z points are above cut IF z1<0 AND z2<0 AND z3<0 THEN check=0 ! three z points are below cut IF zl=0 AND z2=0 AND z3=0 THEN check=0 ! three z points are on the cut !

! when intersect IF check=l THEN
!

! I) zl=0 case IF zl=0 THEN ! at least one point is on the slice IF z2=0 AND z3~>0 THEN ! zl=0 z2=0 z3<>0 x ] w=x 1 ylw=yl x2w=x2 y2w=y2 found= I
ELSE IF z2>0 THEN
IF z3<=0 THEN ! zl=0 z2>0 z3<=0 xlw=xl ylw=yl n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3) x2w=(n2*x3+n3*x2)/(n2+n3) y2w=(n2*y3+n3*y2)/(n2+n3) found= I
END IF ! zl=0 z2>0 z3>0 not the case ELSE IF z2<0 THEN
IF z3>=0 THEN ! zl=0 z2<0 z3>=0 xlw=xl yl w=yl CA 022~0822 1998-lO-01 - W O 97/37317 PCT~US97/05419 n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3) x2w=(n2*x3+n3*x2)/(n2+n3) y2w=(n2*y3+n3*y2)/(n2+n3) found= I
- END IF ! zl=0 z2<0 z3<0 not the case END IF
END IF
!

! 2) zl>0 case IF zl>0 THEN ! at least one point is above slice plane IF z2=0 THEN
IF z3~=0 THEN ! zl>0 z2=0 z3<=0 xlw=x2 ylw=y2 nl=Abs(zl) ! nl:n3 ratio n3=Abs(z3) x2w=(nl *x3+n3*xl)/(nl+n3) y2w=(nl *y3+n3*yl)/(nl+n3) found= 1 END IF ! zl>0 z2=0 z3>0 not the case ELSE IF z2>0 THEN
IF z3~0 THEN ! zl>0 z2>0 z3<0 n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3 ) x 1 w=(n2*x3+n3 *x2)/(n2+n3) yl w=(n2*y3+n3*y2)/(n2+n3) nl=Abs(zl ) ! nl :n3 ratio n3=Abs(z3) x2w=(nl *x3+n3*xl)/(nl+n3) y2w=(nl*y3+n3*yl)/(nl+n3) found=l END IF ! else not the case ELSE IF z2<0 THEN
IF z3=0 THEN ! zl>0 z2<0 z3=0 xlw=x3 ylw=y3 nl=Abs(zl ) ! nl :n2 ratio n2=Abs(z2) x2w=(nl*x2+n2*xl)/(nl+n2) y2w=(nl *y2+n2*y2)/(nl+n2) found= I
ELSE IF z3>0 THEN ! zl>0 z2<0 z3>0 nl=Abs(zl) ! nl:n2 ratio n2=Abs(z2) xlw=(nl *x2+n2*xl )/(nl+n2) ylw=(nl *y2+n2*y 1 )/(nl+n2) n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3) x2w=(n2*x3+n3 *x2)/(n2+n3) y2w=(n2*y3+n3*y2)/(n2+n3) found=l ELSE IF z3<0 THEN ! zl>0 z2<0 z3<0 nl=Abs(zl ) ! nl :n2 ratio n2=Abs(z2) xlw=(nl*x2+n2*xl)/(nl+n2) CA 022~0822 1998-lO-01 - W O 97/37317 PCTrUS97/05419 yl w=(nl *y2+n2*yl)/(nl+n2) n I =Abs(z I ) ! n 1 :n3 ratio n3=Abs(z3) x2w-(nl*x3+n3*xl)/(nl+n3) y2w=(n 1 * y3+n3 * y I )/(n I +n3 ) found= I
END IF
END IF
END IF
!

! 3) zl<0 case IF zl<0 THEN ! at least one point is below slice plane IF z2=0 THEN
IF z3>=0 THEN ! zl<0 z2=0 z3>=0 xlw--x2 yl w=y2 nl=Abs(zl) ! nl:n3 ratio n3=Abs(z3) x2w=(nl *x3+n3*xl)/(nl+n3) y2w=(nl *y3+n3*yl)/(nl+n3) found= I
END IF
ELSE IF z2>0 THEN
IF z3=0 THEN ! zl<0 z2>0 z3=0 xlw=x3 ylw=y3 nl=Abs(zl) ! nl:n2 ratio n2=Abs(z2) x2w=(nl *x2+n2*xl)/(nl+n2) y2w=(nl*y2+n2*yl)/(nl+n2) found=l ELSE IF z3>0 THEN ! zl<0 z2>0 z3>0 nl =Abs(zl ) ! nl :n2 ratio n2=Abs(z2) xlw=(nl*x2+n2*xl)/(nl+n2) ylw=(nl*y2+n2*yl)/(nl+n2) nl=Abs(zl) ! nl:n3 ratio n3=Abs(z3) x2w=(nl *x3+n3*xl )/(nl+n3) y2w=(nl *y3+n3*yl)/(nl+n3) found= I
ELSE ! zl<0 z2>0 z3<0 nl=Abs(zl) ! nl:n2 ratio n2=Abs(z2) xlw=(nl*x2+n2*xl)/(nl+n2) ylw=(nl*y2+n2*yl)/(nl+n2) n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3 ) x2w=(n2*x3+n3 *x2)/(n2+n3) y2w=(n2*y3+n3*y2)/(n2+n3) found= 1 END IF
ELSE IF z2<0 THEN
IF z3>0 THEN ! zl<0 z2<0 z3>0 nl=Abs(zl) ! nl:n3 ratio n3=Abs(z3) CA 022~0822 1998-10-01 - W O 97/37317 PCTrUS97/05419 .-xlw=(nl*x3+n3*xl)/(nl+n3) ylw=(nl*y3+n3*yl)/(nl+n3) n2=Abs(z2) ! n2:n3 ratio n3=Abs(z3) x2w=(n2*x3+n3*x2)/(n2 t n3) - y2w=(n2*y3+n3*y2)/(n2+n3) found= I
END IF
~ END IF
END IF
END IF
IF found=l THEN
x I r=Round(x 1 w,decirnal) ! round intersecting line coord y I r=Round(y I w,decimal) x2r=Round(x2w,decimal) y2r=Round(y2w,decimal) WRITE #2:xlr,ylnx2r,y2r ! save rounded line coord END IF
NEXT i ASK #2:Filesize num_rec num_ln=num_rec/4 ! number of lines in *.ln file CLOSE #2 END SUB
!************~**************
! Subroutine: vtx_to_line_h !********************~******
SUB vtx_to_line_h(name$,slice_h,decimal,file In) ! i,l,i,o ! Cut an object at a certain height and make line files ! name$: object name, *.vtx ! slice_h: cut height ! decimal: round line coords ! file_ln: line record file name. *.ln DIM a(0,0) ! initialize com$="md object\" & name$ ! if no object directory, create it CALL dos(com$) CLEAR
file_vtx$="object~" & name$ & ".vtx" ! file name CALL open_file(#l,file_vtx$,error) ! open vertex coord file IF error I THEN Exit sub ASK #I:filesize num rec num_tri=num_rec/9 PRINT " Making file ":str$(file_1n);".1n. Wait..."
! make a line file CALL get_line(name$.~1,0,a(,),num_tri,slice_h,decimal,file_1n,nurn_1ine) CLOSE #l END SUB
!**************~**********
! Subroutine: vtx_to_iine !*************************
SUB vtx_to line(name5,start,end,dh,decimal) ! i,i,i,i,i ! Al-t--m~tic:~lly cuî an object with dh thi(~kn~ and make line files ! name$: object name. *.vtx ! start,end: start and end number of line files to make I.ln [h=.0], start.ln [h=(start-l)*dhl ! dh,decimal: layer thickness. round line coord.

CA 022~0822 1998-lO-01 DIM a(0,0) ! initialize com$="md object\" & name$ ! if no object directory, create it CALL dos(com$) CLEAR
file_vtx$="object\" & name$ & ".vtx" ! file_name CALL open_file(#l,file_vtx$,error) ! open vertex file IF error=l THEN Exit sub ASK #I:filesize num_rec num_tri=num rec/9 array=l ! check memoIy for array usuage WHEN error in MAT REDIM a(num tri,9) CALL file_to_array(file_vtx$,a(,),num tri,9) USE
array=0 END WHEN

! making line files for cuts no_line_file=0 ! number of empty line files num_file=end-start+l ! number of line file FOR i=start TO end ! create line files slice_h=(i- I )*dh ! slice height PRINT
PRINT "Making file ";str$(i);".1n";" (";i;"/";end;"). Wait.."
! get one line file at certain hCALLget line(name$,#1,array,a(,),num tri,slice_h,decim~li,mlm_line) l if line file is empty, update counter.
IF num_line~3 THEN no_line_file=no_line_file+ I
NEXT i PRINT " *** OUTPUT ***"
PRINT
PRINT num file;"files are made. "
PRrNT no_line_file;"files have less than 3 lines."
CLOSE #l END SUB
!*************
! End of File !*************

CA 022~0822 1998-10-01 W O97/37317 PCTrUS97105419 !***********************************************************
! Written by Cheol H. Lee ! University of Utah ! File: 72-2-ln2.tru ! Date: 2/96 - ! Object: scale and shift line coord in line file, and find min and max x,y of line coord ! Input: *.ln file, old line file ! Output: *.ln file, new line file !****************************************~*******************
library "69-gln.tru"
library "3dlib.trc"
library "69-ut.tru"
name_in=105 name out=105 scale=l xshifP10 yshift=5 call line_size(name_in xmin xm~x,ymin,ym~x n~m_line) print name_in xmin xnn~x~ymin~ymax callscale_shift line(name_in,scale,xshift,yshift,xmin,xm~x,ymin,ym~x,n!~me_out) call line_size(name on~ xmin xmax,ymin,ymax,num_line) print name_o--t xmin xm ix~ymin~ymax end EXTERNAL
!*********
! Summary (72-2-ln2) !*********
! SUB line_size(name$ name,xmin xm~x ymin,ym ~x n~lm-line) ! SUB scale_shift_line(name_in,scale,xshift,yshift,xmin,xmax,ymin,ym~x,n~-nP_out) !****************~********
! Subroutine: line_size !**********~ *******
SUB line size(r~m~$ n~m~ xmin,xmS.x,ymin,ym~x n~m_line) ! i,o,i,i,i,i,i ! Fine min and max x,y in a line file ! name$: object name. *.vtx ! name: line file num. name.ln ! x,ymin,max: min and max of x, y ! num_line: number of lines in *.ln file_ln$="object\" & name$ & "\" & Str$(name) & ".In" ! file_name CALL open_file(#l,file_ln$,error) ! open line file IF error=I THEN exit sub ASK #l :filesize num_rec num_line=num_rec/4! number of lines RESET # I :Begin xmin,ymin=1000! initialize min,max of x,y,z xmax,ymax=- 1000 FOR i=I TO num line ! find min and max x,y of all lines READ #I:xl,yl,x2,y2 CALL min3(xl x~ xmin xmin) - CALL min3(yl,y2,ymin,ymin) CALL max3(xl ~ xm~x,xm ~
CALL max3(yl,y2,ymax,yrnax) NEXT i CLOSE #I
END SUB

CA 022~0822 1998-10-01 !*********~*******************
! Subroutine: scale_shift line !*****************************
SUB scale_shift_line(n~m~$ n~m~_in,~c~le,x~hift,y~hift,xmin xm~x,ymin,ym~x,n~m~_out) !i(5),o(5) ! Enlarge and shift line coord by scaling x,y coords ! name$: object name. *.vtx ! name_in,_out: original and scaled line files. *.ln ! scale : conversionratio. old_coord*scaleqlew_coord ! x,yshift: shift distance. x_new=x_old+xshift, y_new=y_old+yshift ! x,ymin,max: new min and max x,y of line file after scaling file_in$="object\" & name$ & "\" & str$(name_in) & ".In" ! input file file_out$="object\" & name$ & "\" & str$(name_out) & ".ln" ! output file OPEN #l :Name file_in$,Access Outin,Create Newold,Org Record IF file_in$<>file_out$ THEN
OPEN #2:Name file_out$,Access Outin,Create Newold,Org Record ERASE #2 SET#2:Recsize 10 END IF
ASK #l :filesize num_rec num_line-num_rec/4 ! number of lines in *.ln RESET #l:Begin FOR i=l TO num line ! scale and shift all lines RESET #I:Record (i-1)*4+1 READ #I:xl,yl,x2,y2 x I =x 1 * scale+xshift ! scale and shift x2=x2 * scale+xshift yl=yl *scale+yshift y2=y2*scale+yshift IF file_in$<>file_out$ THEN
WRITE #2:xl,yl,x2,y2 ELSE
RESET #I:Record (i-1)*4+1 WRITE #I:xl,yl,x2,y2 END IF
NEXT i CAl,L line_size(name_in xmin xm ~x,ymin,ym~x,nl~n~_line) ! find min max x,y CLOSE #l IF file in$<>fi1e_out$ THEN
CLOSE #2 END IF
END SUB
~**********~*~
! End of File !*************

CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/054}9 .-!********************************~*************************
! Written by Cheol H. Lee ! University of Utah !

! File: 72-3-lpl.tru - ! Date: 1/96 !

! Object: make complete loops, and save coord info in array ! Input: a(num of lines,4) ! Output: b(num of lines,4), index(num of loops,2) !**********************************************************
! M E M O
! - coord in *.ln file are checked, verified, and sorted to make complete loops ! - eliminate lines which are points or duplicated lines, and fill gaps or add missing lines, if any ! - a(num of llnes,4) from *.ln: (xl,yl,x2,y2)(x3,y3,x4,y4),..
! - b(sorted num of lines,4): (xl,yl,x2,y2)(x2,y2,x3,y3),..
! - index(num of loops,2):
(startdim b,enddim b)(startdim_b?enddim b),..
!**********************************************************
EXTERNAL
!*********
! Sumrnary (72-3-lp 1 ) !*********
! SUB refine line(a(,),dim_a 1 ,b(,),dim_b 1 ) ! SUB find connected_line(a(,),dim_al,xl ,yl,x2,y2,&
& x I c,y I c,x2c,y2c,found,count line) ! SUB find_closest_line(a(,),dim_al,x_ref,y_ref, &
& x I d,y I d,x2d,y2d,d min,count_line) ! SUB make_loop(a(,),dim_a I ,d loop,b(,),dim b 1 ,index(,),dim_index 1 ) !*************************
! Subroutine: refine_line !*************************
SUB refine_line(a(,),dim_a I ,b(,),dim_b I ) ! i,i,o,o ! Elimin~te lines which are not lines but points in line file.
! a(,) : line coord record array. a(dim_al,4) ! dim al: number of lines ! b(,) : updated line coord array. b(dim bl,4) ! dim_bl: updated array size. new number of lines MAT REDIM b(dim_al,4) ! declare array size dim_b I =0 FOR i=l TO dim al ! check all lines for points - IF a(i,l)c>a(i,3) Or a(i,2)<>a(i,4) THEN ! if a line is not a point dim bl=dim bl+l b(dim bI,I)=a(i,I) ! save line in new array b(dim_bl ,2)=a(i,2) b(dim bl,3)-a(i,3) b(dim_bl ,4)=a(i,4) END IF

CA 022~0822 1998-10-01 - WO97137317 PCT~S97/05419 NEXTi IF dim_bl=0 THEN ! if new line file is empty, PRINT "Problem, no line. Press any key" ! print error message GET KEY getkey EXIT SUB
ELSE
PRINT dim_b I ;"lines revised. ";dim_a 1 -dim_b 1 ;"points removed. "
END IF
END SUB
!~*~*****~***~********~***********
! Sul,1oulh-c. find_conneeted_line !**********~**********************
SUB find_eonneeted line(a(,),dim_al ,x I ,yl ,x2,y2,& l i,i,o,. .,i/o & x 1 e,y I c,x2c,y2c,found,eount_1ine) ! Find a line starting at x2,y2, and remove duplieated lines.
! a(,), dim_al : line array and size. a(dim_al,4) ! xl,yl,x2,y2 : a line coord ending at x2,y2 ! xle,ylc~x2c,y2e: a line eoord starting at x2,y2 ! found : 0=if not found, I=if found connected line at x2,y2 ! eount_line number of lines cheeked found=0 ! initialize FOR i=l TO din~ al ! find a line starting x2,y2 by searehing all lines ! -- eheek lines whieh are not checked yet IF a(i, 1)>=0 THEN
xl 1=a(i,1) yl 1=a(i,2) x22=a(i,3) y22-a(i,4) !-- check eonnection at starting point to x2,y2 IF x 1 1 =x2 And y I I =y2 THEN
a(i, I )=-10, ! mark when eheeked eount_line=eount_line+l ! update eount_line IF x22<>x 1 Or y22<>y 1 THEN ! if not duplicated line, keep it xlc=xl 1 ylc=yl I
x2e=x22 y2e=y22 found=1 END IF
!-- eheck CoMeCtion at end point to x2,y2 ELSE IF x22=x2 And y22=y2 THEN
a(i,1)=-10 ! mark when eheeked eount line=eount line+1 IF xl 1 ~x 1 Or y 1 1 <>yl THEN ! if not duplicated line, keep it xle=x22 yle=y22 x2e=x11 y2e=y 1 1 CA 022~0822 1998-10-01 found=l ENDIF
ENDIF
ENDIF
NEXTi - ENDSUB
!********~************************
! Subroutine: find_closest line !*********************************
SUB find_closest_line(a(,),dim al,x_ref,y_ref, & ! i(4),o(5),i/o & xl d,yld,x2d,y2d,d min,count_line) ! If a connected line was not found, find closest line from x_ref,y_ref ! a(,), dim al: line coord array and its size. a(dim_al,4) ! x_ref,y_ref: .~e~..ce point to find closest line from ! xld,yld,x2d,y2d: closest line from reference point (x_ref,y ref~
! d_min : gab between ref point and closest line ! count_line: number of lines checked d_min=100000 ! initialize line~os=0 !-- check all lines FORi=l TO dim_al !-- check line which are not checked yet IF a(i, 1)>=0 THEN
xl=a(i,l) yl =a(i,2) x2=a(i,3) y2=a(i,4) d=((x_ref-xl)~2+(y_ref-yl)~2)~0.5 ! distance between x I ,yl and reference point IF d<d min THEN ! update distance xld=xl yld=yl x2d=x2 y2d=y2 d min=d line_pos=i ENDIF
d=((x_ref-x2)~2+(y_ref-y2)A2)~0.5 ! distance between x2,y2 and reference point IF d~d_rnin THEN ! update distance xld=x2 yld=y2 x2d=x 1 y2d=yl d_min=d line~os=i ENDIF
ENDIF
NEXTi CA 022~0822 1998-10-01 WO 97137317 PCT/US97/05419 . -IF line pos=0 THEN ! if the closest line is not found, error PRINT "Problem!!! Can not find closest line."
ELSE
a(line~os, I )=-10 ! mark if checked count_line=count_line+ 1 ! update counter END IF
END SUB
!*************~*********
! Subroutine: make_loop !***********************
SUB make loop(a(,),dim_a I ,d loop,b(,),dirn_b 1 ,index(,),dim_index I ) ! i(3),o(4) ! Make closed loops by connectin~ all lines and adding missing lines ! Call find closest line, find_connected line ! a(,), dim_al: line coord array and its size. a(dim al,4) (xl ,yl ,x2,y2)(x3,y3,x4,y4)(x5,y5,x6,y6),..
! d_loop : max gab allowed for missing line if gab>d_loop, new loop exists ! b(,),dim_bl: loop line coord array and its size. b(dim bl,4) (xl,yl,x2,y2)(x2,y2,x3,y3)(x3,y3,x4,y4),..
! index(,): loop line file index and its size. index(dim_indexl,2) (start dim_b,end dim_b)(start dim_b,end dim_b),..
! dim_index 1: number of loops MAT REDIM b(2*dim_al,4) ! declare array size count_line=0 ! initialize count lines considered dirn_b 1=0 ! initialize number of connected line count closest_line=0 !-- first line of first loop dim_indexl=l ! number of loops index(dim_index I, I )= I ! first loop start index x I =a( I, I ) ! start line yl=a(1,2) x2=a( 1 ,3) y2=a( 1 ,4) dim b I =dim_b I + 1 ! keep the first line b(dim_b 1,1 )=x I
b(dim_b I ,2)=y 1 b(dim_bl ,3)=x2 b(dim bl,4)=y2 a( I, I )=-10 ! mark if considered count_line=count line+ I
x_start=xl ! start a loop from xl,yl y start-yl !-- make closed loops DO
found=0 ! find connected line from xl,yl CALL find_connected line(a(,),dim_al,xl,yl,x2,y2,&
& xlc,ylc~x2c,y2c,found,count_1ine) !-- if found connected line, keep the line IF found=l THEN
dim_bl=dim bl +l b(dim_bl,l)=xlc b(dim_b I ,2)=y I c CA 022~0822 1998-10-01 b(dim_b I ,3)=x2c b(dim_b I ,4)=y2c END IF
!-- if not found connected line, find closest line - IF found=0 THEN

CALL find closest line(a(,),dim al,x2,y2, &
& x 1 c,y 1 c,x2c,y2c,d min,count line) count_closest_line=count_closest line+l !-- add mlssing line by filling gab IF d_min<d_loop THEN
IF x2=x_start And y2=y_start THEN ! check d_loop PRINT "Problem! ! ! Minimum loop distance is too small."
GET KEY key END IF
dim_b I =dim b I - I ! add missing line b(dim_b I, I )=x2 b(dim bl,2)=y2 b(dim_b 1,3 )=x I c b(dim_b I ,4)=y I c dim bl=dim bl I
b(dim_bl ,I)=xlc b(dim b I ,2)=y I c b(dim_b 1 ,3)=x2c b(dim_b I ,4)=y2c !-- new loop ELSE
!-- close loop IF x_startc>x2 OR y start<~y2 THEN
dim_b I =dim_b I + I
b(dim_b I, I )=x2 b(dim_b I ,2)=y2 b(dim_bl,3)=x start b(dim_b I ,4)=y_statt END IF
index(dim_indexl,2)=dim_bl ! end loop index dim b I =dim b 1- I ! new start line b(dim bl,l)=xlc b(dim b I ,2)=y I c b(dim bl,3)=x2c b(dim bl,4)=y2c dim index l=dim_indexl+l index(dim index I, I )=dim_b I ! start loop index x_start=x I c y starl=y I c END IF
END IF

CA 02250822 1998-lO-01 x 1 =x I c ! new line to be connected yl=ylc x2=x2c y2=y2c LOOP U~TIL count line>=dim_a I
!-- close last loop IF x start~>x2 OR y_start~y2 THEN
dirn_b I =dim_b 1 + I
b(dim_b I, I )=x2 b(dim bl,2)=y2 b(dim_bl ,3)=x start b(dirn_b 1 ,4)=y_start END IF
index(dim_indexl,2)=dirn_bl ! end loop index PRINTdim indexl;"loops,";dim_bl;"lines,";count closest_line;"gabsexist."
END SUB
!*************
! End of File !*************

CA 022~0822 1998-lO-01 - W O 97/37317 PCTrUS97/05419 !*~*~***************************************************************
! Written by Cheol H.Lee ! File: 72-4-pt.tru ! Date: 1/96 ! Object: Read loop file (*.lp, *.lpx), ar.d make point file (*.pt, *.ptx) ! Input: loop record file (*.lp, *.lpx) ! Output: point record file (*.pt, *.ptx) !*********************************************************************
! M EM O
! - *.lp: ccw loop record file. (xl,yl,x2,y2)(x2,y2,x3,y3),..
! - *.lpx: loop index record file. each loop has 10 records (start line num, end line num, xd,yd, xu,yu, xl,yl, xr,yr) where xd,yd=ymin pt. xu,yu=ymax pt. xl,yl=xmin pt, xr,yr=xmax pt ! - *.pt: point coord record file (xl,yl)(x2,y2)(x3,y3),..
! - *.ptx: point index record file. each loop has 10 records (num of start pt, num of end pt, xd,yd,xu,yu,xl,yl,xr,yr) ! - two methods are available in making point file 0=include all start and end points of lines I=even distance points, ignore start and end points of lines !*********************************************************************
library "71 -3-lp 1 "
library "7 I-gln"
library "7 I-ut"
library "utillib1"
name$="fordcar"
start= 1 end=2 step=.2 decimal=2 method=l call read_record file("object\fordcar\6.1p",4) !call loop to-point(n~m~$~t~rt~ont1~ctpp~decimql~mpth~d) !call draw_point(name$,1,0,100,100) end EXTERNAL
!~-t~ t ! Summary (72-4-pt) ! *********
SUB find~oint by_vtx(xl ,yl ,x2,y2,step,decimal,#1 ,count) SUB find_point_by_dis(x_end,y_end,x2,y2 step.~1~cimal,#1,count) ! SUB one_loop_to_point(name$,fi1e_name$,step,decimql num_point,method) ! SUB loop_to point(name$,start,end,step,decimal,method) ! SUB scale~oint(name$,in_num,x_scale,y_scale,decimal,out_num) !*******************************
!Subluu~c: find_point_by_vtx !*******************************
SUB find_point_by_vtx(xl,yl,x2,y2,step,decimal,#1,count) ! i(6),i/o,i/o - ! Find discrete point coords including start and end points of a line ! xl,yl,x2,y2: line coord to ~lis~
! step, decimal: distance bw points. round decimal point ! #1: point file channel (*.pt) ! count: number of total points saved in point file dx=x2-x 1 dy=y2-yl CA 022~0822 1998-lO-01 d=(dx~2+dy~2)~0.5 ! length of a line num_pt=int(d/step) ! number of points on a line ~F num_pt<l THEN ! if length of a line is shorter then one step, save end point WRITE #I:x2,y2 count=count+l ELSE ! if length of a line is longer then one step, discretize FOR i=l TO num_pt ratio=i*step/d x=x I ~ratio*dx y=y I +ratio*dy xqound(x,decimal) y=round(y,decimal) WRITE #I:x,y count count+ I
NEXT i IF x<>x2 or y<>y2 THEN ! check if end point is included WRITE #I:x2,y2 count=count+ 1 END IF
END IF
END SUB
!*******************************
! Subroutine: find point_by_dis !****************************~**
SUB find_point_by_dis(x_end,y_end,x2,y2,step,decimal,#1,count) ! i/o,i/o,i(4),i/o,i/o ! Find point coords with even distance on a line and make point file ! x_end,y_end: last point in a pt file. previous point ! x2,y2: end point of a line ! step, decimal: distance bw points. round decimal point ! #1: point file channel (*.pt) ! count: number of total points saved in point file dx=x2-x end dy=y2-y_end d=(dx~2+dyA2)~0.5 num_pt=int(d/step) ! number of point in a file IF num_pt<l THEN ! if length of a line is shorter then one step, skip Exit sub ELSE ! if length of a line is longer then one step, disc,~;li;ce a line with even step size FOR i=l TO num pt ratio-i*step/d x=x_end+ratio*dx y=y_end+ratio*dy x=round(x,decimal) y=round(y,decimal) WRITE #I:x,y COul~l--C~ + I
NEXTi CA 022~0822 1998-lO-01 W O 97/37317 PCT~US97/05419 -x_end=x ! keep end point coordinates y end-y END IF
END SUB
!****************~*****************
- ! Subroutine: one_loop_to_point !*************************~*~
SUB one_loop_to_point(name$,file_num,step,decim~1,nnm_point,method) - ! i,i/o,i,i,o,i ! Read a loop file, and make a point file ! name$: object name ! file_num: file number for *.lp, *.lpx, ~.pt, *.ptx files ! *.pt: point coord record file (xl,yl)(x2,y2)(x3,y3),..
! *.ptx: point index record file. each loop has 10 records (num of start pt, num of end pt, xd,yd,xu,yu,xl,yl,xr,yr) ! step, decimal: distance bw points. round decimal point ! num point: num of points in *.pt ! method: 0=include all start and end points of lines I=even distance points, ignore start and end points of lines file_loop$="object\" & name$ & "\" & str$(file_num) & ".Ip" ! file names file point$="object\" & name$ & "\" & str$(file_num) & ".pt"
file_index_lp$="object\" & name$ & "\" & str$(file_num) & ".Ipx"
file_index_pt$="object\" & name$ & "\" & str$(file_num) & ".ptx"
CALL open_file(#l,file_loop$,error) IF error=l THEN Exit sub CALL open_file(#2,file_index_1p$,error) IF error= I THEN Exit sub OPEN #3:name file_point~,~rceee outin,create newold,organization record OPEN #4:name file_index pt$,access outin,create newold,organization record ERASE #3 ERASE #4 SET #3:RECSIZE 10 ! record size of point file SET #4:RECSIZE 10 ! record size of loop index file RESET #l :Begin RESET #2:Begin ASK #2:FILESIZE num_record ! get number of records of loop index file IF num record=0 THEN ! if loop index file is blank, exit EXIT SUB
END IF
LET num_loop=num_record/l 0 ! number of loops in loop file count_pt=0 !

! get point coord for all loops FOR loop=l TO num_loop READ #2:1n_start,1n_end,xd,yd,xu,yu,xl,yl,xr,yr ! get loop index RESET#1:Record(In_start~ 4+]
~ READ#l:xstart,ystart,x2,y2 ! startline WRITE #3:xstart,ystart ! start point count_pt=count ptTI
WRITE #4:count_pt ! start point number of a loop CA 022~0822 1998-10-01 WO 97/37317 PCT/US97/054~9 ! discretize first line IF method=0 THEN ! passing all vertex method CALL find_point_by_vtx(xstart,ystart,x2,y2,step,decimal,#3,count_pt) ELSE ! even point distance method x_end=xstart y_end=ystart CALL find_point_by_dis(x end,y_end,x2,y2 ~tf p ~ecimal,#3,count_pt) END IF
!

! compute points for all lines of a loop FOR i=ln_start+ l TO ln_end READ #I:xl,yl,x2,y2 ! get line coordinate IF method=0 THEN ! passing all vertex method CALLfind_point by_vtx(xl,yl,x2,y2,step,decimal,#3,count pt) ELSE ! even point distance method CALL find_point_by_dis(x_end,y_end,x2,y2,step,decimal,#3,count_pt) END IF
NEXT i WRITE #3:xstart,ystart ! return start point count_pt=count_pt+ I
WRITE #4:count_pt,xd,yd,xu,yu,xl,yl,xr,yr ! save in pt index file NEXT loop PRINT count pt;"points in ";str$(file_num);".pt";", ";nurn_loop;"loops in ";str$(fi1e_num);".ptx"
num~oinl-~u~ Qt CLOSE #l CLOSE #2 CLOSE #3 CLOSE #4 END SUB
!***************************
! Subluu~ . Ioop_to_point !~lt~t~t~*~***************
SUB loop_to point(name$~start~en~l~etep~lecim~l~m~thod) ! i,i/o,i/o,i(3) ! Read loop file, and make point file ! start, end: start and end number of file for loop, point, index file ! step, decimal: distance bw points. round decimal point ! method: 0=include all start and end points of lines I=even distance points, ignore start and end points of lines FOR i=start TO end ! create all point files PRINT
PRINT "Making file ";str$(i);".pt";" (";i;"/";end;"). Wait.."
CALL one_loop_to_point(name$,i,step,decim:~1 n--m_point,method) NEXT i CA 022~0822 l998-lO-Ol - W 0 97/37317 PCTtUS97tO5419 PRINT end-start+l;"files are made. "
END SUB
!*************************
! Subroutine: scale_point !*************************
SUB scale point(name$,in_num,x_scale,y_scale,decimal,out_num) ! i(5),o ! Scale coords in point files ! in_num: input point file num to scale *.pt ! x_scale,y_scale: scale factor. new_x=old_x*x_scale,new_y=old_y*y_scale ! decimal: round decimal ! out_num: output point file number *.pt file_in$="object\" & name$ & "\" & str$(in_num) & ".pt"
file_out$="object\" & name$ & "\" & str$(out_num) & ".pt"
CALL open_file(#l,file_in$~error) IF error=l THEN Exit sub OPEN #5:name file_out$,access outin,create newold,c,~a~ ion record ERASE #5 SET #5:RECSIZE 10 ! record size of output file ASK #l :FILESIZE num_rec ! number of records of loop index file num_pt=num_rec/2 FOR i= I TO num_pt ! scale all point READ # I :x,y xnew=round(x*x scale,decimal) ynew=round(y*y_scale~decimal) WRITE #S:xnew,ynew NEXT i END SUB
!*************
! End of File !*************

CA 022~0822 1998-lO-01 - W O 97/37317 PCTrUS97/05419 ~ Written by Cheol Lee ! File: 72-5-ctl.tru ! Date: 6/96 !

! Object: match bot and top loops reading point file ! Input: *.pt, *.ptx ! Output: match loop array match(,) !******************~**********************************************
! M EM O
!

! deal with d~ ulaly num of loops ! ignore second layer of children loops ! a(,): a(num_lp,l2) start,end,xd,yd,xu,yu,xl,yl,xr,yl,in~ex m-m_chjld ! index: 100 < 110 120 130 ..; 200 < 210 220 230.., 000 mother children mother children empty ! match(,): (num_lp*2,12) 0 index for blank file ex) match( l ,0) for top blank match bot loop (al ) and top loop (a2) and store match info match bot index and top index in ascending order match Ist Ip(bot)-2nd Ip(top), 3rd lo(bot)-4th Ip(top), etc (start,end,xd,yd,xu,yu,xl,yl,xr,yl,index.num_child) !*******~****************~****************************************
library "utillib.tru"
name$="sink"
file_num=17 clear dim match(0,0) call ptx_to_match(name$~fi1e_n-lm;m~trh(~)) ! ,o mat print match end EXTEFUNAL
!*********
! Summary (72-5-ctl) ! *********
SUB find_mother_loop(a(,),index,done,i_mom) ! i/o,i,o,o SUB find_child loop(a(,),index,i_mom) ! i/o,i,o ! SUB relate_loop(name$,file_num,a(,),num mother) ! i,i,o SUB make_b(a(,),index,b(,)) ! i,i,o SUB sort_b(b(,)) ! i/o SUB screen_b(b(,).num 2nd) ! i/o,o,o SUB update_a(b(,).num ~nfi in~lrx,a(,)) 1 i,i,i,o SUB sort_a(a(,),num_mom) ! i/o,i ! SUB screen_child(a(,),num mother) ! i/o,i ! SUB match_2_1Oop(al(,),a2(,),num_moml,num_mom~ m~trh(,)) ! i,i,i,i,o ! SUB ptx_to_match(name$,file_n--m,m ~trh(,)) ! ,o !******************************
! Sullv..lillc: frnd_mother_loop ~ *~*~*********************
SUB find_mother loop(a(,),index,done,i_mom) ! i/o,i,o,o ! Find main mother loops and give index number.
! mother loop has the smallest y among loops ! a(,): pt index loop array. a(num Ip.12) CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 (start pt,end pt,xd,yd,xu,yu,xl,yl,xr,yl,in(il x nnm_child) ! index: mother index number, ex) 100, 200, 300..
! done: I=no more loop not considered, finish relate loop process 0=more loops to be considered.
! i_mom: index number of mother loop in array a(,) num_loop=ubound(a, l ) min_yd=1000 ! init min yd i_mom=0 ! init index number i FOR i=l TO num loop ! find lowest (smallest yd) loop not considered IF a(i, l l )=0 THEN ! if not considered IF a(i,4)<min yd THEN ! if found lower loop, check yd min_yd=a(i,4) ! update min_yd and mm_i i_mom-i END IF
END IF
NEXT i IF i_mom=0 THEN ! if not found, done=l done= I
ELSE
a(i_mom,l l)=index ! if found, mark index END IF
END SUB
!**~*~**~**il***~*~*~**#*~*~***~
! Subroutine: find_child_loop !**~**~*~*~**************~**
SUB find_child loop(a(,),index,i_mom) ! i/o,i,i ! find child loop and give index number ! child loops have larger yd,xl and smaller yu,xr than mo~her ! a(,): pt index loop info array. a(num_lp,12) (start pt,end pt,xd,yd,xu,yu,xl,yl,xr,yl in-l~qx n~m_child) ! index: mother index number, ex) 100, 200, 300..
child index num will be 110,120,130,..
100 < 110 120 130 ..; 200 < 210 220 230.., 000 mother children mother children empty ! i_mom: index number of mother in array a(,) num loop=ubound(a,l) xdm=a(i_mom,3) ! mother boundary ydm=a(i_mom,4) xum=a(i_mom,5) yum=a(i_mom,6) xlm=a(i_mom,7) ylm=a(i_mom,8) xrm=a(i_mom,9) yrm=a(i_mom,10) count=0 ! child count FOR i=l TO num_loop ! flnd lowest (smallest yd) loop not considered IF a(i, l l )=0 THEN ! if not considered IF a(i,4)>ydm and a(i,6)<yum and a(i,7)>xlm and a(i,9)<xrm THEN
il~d~ x-u~d~x+ 10 ! update child index cuu~ ,uu~
a(i, l l )=index END IF
END IF
NEXT i CA 022~0822 1998-10-01 - WO 97/37317 PCT/US97/05419 . -a(i_mom, l 2)=count ! save num of child at mom END SUB
!**************************
! Subroutine: relate_loop !~***************~********
SUB relate_loop(name$,fi1e_num,a(,),num mother) ! i,i,o,o ! Find loop re!~tionchir reading index file. if blank file a(0,12) ! mother loop has smallest yd ! children loops have larger yd,xl and smaller yu,xr than mother ! name$: object name ! file_num point file and index file number. *.pt, *.ptx ! a(,): a(num Ip,12) start~end~xd~yd~xu~yu~xl~yl~xr~yl~in~lex n~m-child ! index: 100 < 110 120 130 ..; 200 < 210 220 230.., 000 mother children mother children empty ! num_mother: num of mother loops file ptx$="object\" & name$ & "~" & str$(file_num)&".ptx" ! index file name CALL open_file(#l,file_ptx$,error) ! save loop index in array IF error=l THEN exlt sub ASK ~I:filesize num_rec num_loop=num rec/10 !numofloop MAT REDIM a(num_loop,12) ! prepare array IF num_loop=0 THEN exit sub ! if blank file a(0,12) FOR i= I TO num_loop ! store loop info FORj=l TO 10 READ #I:x a(i,j~=x NEXT j a(i,11)=0 ! init a(i,l2)=0 ! init NEXT i index=0 ! init mother index count=0 DO ! check all loops, find mother and children index=index+ 100 ! update mother index CALL find mother_loop(a(,),index,done,i mom) IF done=l THEN exit do ! if no more mom then exit count=count+ I
index_child=index CALL find_child_loop(a(,),index child,i_mom) LOOP
num_l~lull.~ ,ou !print num_mother !mat print a CLOSE #l END SUB
!*******************
!Subl~ul~ . make_b !*******************
SUB rnake_b(a(,),index,b(,)) ! i,i,o CA 022~0822 1998-10-01 WO 97J37317 PCT/US97/05419 . -! get children loop array b(,) of a mother loop ! a(,): a(num_lp,12) start,end,xd,yd,xu,yu,xl,yl,xr,yl,index,num_child ! index: 100 ~ 110 120 130 ..; 200 < 210 220 230.., 000 mother children mother children empty ! b(,): children loop array. b(num of children,10) (xd,yd,xu,yu,xl,yl,xr,yr,index of a(,),flag) ! flag: sorted order of a child loop num_loop=ubound(a, l ) FOR j=l TO num_loop ! find num child IF a(j, l l )=index THFN num_child=a(j,12) NEXT j MAT REDIM b(num_child,l0) ! b(index of a(),yd,sort num) FOR j=l TO num_child ! make b() index child=index+10*j FOR k=l TO num_loop IF a(k, l l )=index_child THEN
b(j, l )=a(k,3) b(j ,2)=a(k,4) b(j,3)=a(k,5) b(j ,4)=a(k,6) b(j,5)=a(k,7) b(j,6)=a(k,8) b(j,7)=a(k,9) b(j,8)=a(k,10) b(j ,9)=k b(j, l 0)=0 ! init END IF
NEXT k NEXT j END SUB
!********************
! Subluu~ c: sort_b !**********~********
SUB sort_b(b(,)) ! i/o ! sort children loops in b(,) from smallest yd to largest ! b(,) : children loop array. b(num of children. l 0) (xd,yd,xu,yu,xl,yl,xr,yr,index of a(,),flag) ! flag: sorted order of a child loop num_lp=ubound(b, l ) FOR i=l TO num_lp ! sort all loop ymin=10000 ! init index=0 FOR j=i TO num_lp ! find min yd IF b(j,2)<-ymin THEN
ymin=b(j,2) index=j END IF
NEXT j FORj=l TO 10 ! switchtosort temp=b(i,j) b(i,j)=b(index,j) b(index,j)=temp b(i,l0)=i ! order NEXT j NEXT i END SUB

CA 022~0822 1998-10-01 - W O 97137317 PCTrUS97/05419 ..

!*$********************
! Subroutine: screen_b !*********#************
SUB screen b(b(,),num_2nd) ! i/o,o ! remove 2nd child loop ! b(,) : children loop array. b(num of children,l 0) (xd,yd,xu,yu,xl,yl,xr,yr,index of a(,),flag) ! flag: sorted order of a child loop. - I if 2nd child loop ! num_2nd: num of 2nd children loops num_lp=ubound(b, l ) num_2nd=0 FOR i=2 TO num_lp ! compare loops and find 2nd child xd=b(i,l) yd=b(i,2) xu=b(i,3) yu=b(i,4) xl=b(i,5) yl=b(i,6) xr=b(i,7) yr=b(i,8) FORj=l TOi-l ! compareloopswithsmalleryd IF b(j,l0)<>-1 and b(j,2)<yd and b(j,4)>yu and b(j,5)<xl and b(~,7)>xr THEN
b(i,10)= 1 num_2nd=num_2nd+ 1 EXIT FOR
END IF
NEXT j NEXT i END SUB
!**********************
! Subluululc: update_a !**********************
SUB update_a(b(,),num_~nd inrlex,~(,)) ! i,i,i,o ! sort index of child in ascen.lind order of yd, and update a(,).
! make index of 2nd children 0. update num child=num_child-num_2nd ! a(,): a(num Ip,12) start~end~xd~yd~xu~yu~xl~yl~xr~yl~in~l~xlnllm-child ! index: 100 < 110 120 130 ..; 200 < 210 220 230.., 000 mother children mother children empty ! b(,) : children loop array. b(num of children,10) (xd,yd,xu,yu,xl,yl,xr,yr,index of a(,),flag) ! flag: sorted order of a child loop. - I if 2nd child num_a=ubound(a, l ) num_b=ubound(b,1) index child=index ! init FOR i=l TO num_b ! update a(,) with b(,) flag=b(i~10) index_a=b(i,9) IF flag=- I THEN
a(index_a, l l )=0 ELSE
index_child=index+ 10 a(index_a, l l )=index_child END IF
NEXT i CA 022~0822 1998-10-01 WO 97/373~7 PCT/US97/05419 IF num 2nd>0 THEN! update num_child FOR i=l TO num_a IF a(i, l l )=index THEN
num_child=a(i,12) a(i, l 2)=num child-num_2nd END IF
NEXT i END IF
END SUB
!**~****************
! Subroutine: sort a !**#****************
SUB sort a(a(,),num_mom) ! i/o,i ! sort a(,) mom first and child second in ~ccenclin~ order of yd ! ex) 100,200,300,110,120,210,220,310 .
! a(,) a(num_lp,12)start,end,xd,yd,xu,yu,xl,yl,xr,yl,in~ mlnn_child ! num_mom num of mother loops in a(,) DIM c(0,0) num Ip=ubound(a, l ) MAT REDIM c(num_lp, l 2) MAT c=a ! temp work space C~u~ .. _mom ! init, num of mom and I st child FOR i=l TO num_mom ! find num of mom and I st loop index=i* 100 FORj=lTOnum_lp!findnum child IF c(l, I l )=index THEN
num_child=c(j,12) cou..l-cou-~t+num child END IF
NEXT j NEXT i MAT REDIM a(count,l2) FOR i=l TO num mom! save mom info first index=i* 100 FOR j=l TO num_lp! find num_child IF c(j, l l )=index THEN
FOR k=l TO 12 a(i,k)=c(j,k) NEXT k END IF
NEXT j NEXT i count_a=num_mom FOR i=l TO num_morn! save child info next index=i~ 100 num child=a(i,12) FOR j=l TO num_child index_child=index+j* 10 FOR k=l TO num_lp IF c(k.l l)=index_child THEN
count_a=count_a+ I
FOR n=l TO 12 a(count a,n)=c(k,n) NEXT n END IF
NEXT k NEXT j CA 022~0822 1998-lO-01 NEXT i END SUB
!**************************
! Subroutine: screen_child !**************************
SUB screen_child(a(,),num_mother) ! i/o,i ! sort children index with from smallest yd to largest yd ! remove 2nd child making index O and update num_child ! a(,): a(num_lp,l2) start~end~xd~yd~xu~yu~xl~yl~xr~yl~in~le~nlltn-child ! num_mom: num of mother loops in a(,) DIM b(O,O) num_loop=ubound(a, I ) FOR i=l TO num_mother ! check all children of all mothers index=num_mother* 1 00 FORj=1 TOnum loop ! findnum_child IF a(j,l l)=index THEN num_child=a(j,12) NEXT j MAT REDIM b(num_child,10) ! b(index of a(),yd,sort num) CALL make_b(a(,),index,b(,)) ! i,i,o CALL sort_b(b(,)) ! i/o CALL screen_b(b(,),num_2nd) ! i/o,o CALLupdate_a(b(,),num 2n~ in~ ,a(,)) ! i,i,i,o NEXT i !print num mother !mat print a CALL sort_a(a(,),num_mother) END SUB
!*************************
! Subroutine: match_2_100p !*************************
SUB match_2_100p(a1(,),a2(,),num_moml,num m- m~,m~t- h(,)) ! i,i,i,i,o ! match bot and top loops.
! al(,),a2(,): bot and top loop array. al(num_lp,l2) (start,end,xd,yd,xu,yu,xl,yl,xr,yl,in-lr~ nnm_child) ! num_moml,num_mom2: num of mother loops in al(,),a2(,) ! match(,): (num Ip*2,12) O index for blank file ex) match(1,0) for top blank match bot loop (al) and top loop (a2) and store match info match bot index and top index in ~ccen~lin~ order match I st Ip(bot)-2nd Ip(top), 3rd lo(bot)-4th lp(top), etc (start,end,xd,yd,xu,yu,xl,yl,xr,yl,index,num child) DIM temp(O,O) num_al=ubound(al ,1 ) nurn_a2=ubound(a2, 1 ) ! one of top and bot is blank IF nurn_al=O OR num_a2=0 THEN ! blank file exists PRINT "Problem. blank file exist."

CA 022~0822 1998-lO-01 GET KEY key Exit sub ! one of top and bot has I loop ELSE IF num_a 1=1 OR num_a2=1 THEN ! I loop in top or bot MAT REDIM match( 1,2) - match( I ,1 )= I
match( I ,2)=1 ! both have at least 2 loops ELSE IF num_moml=l AND num mom2=1 THEN ! I mom I child MAT REDIM match(Z,2) match( I ,1)=1 match( 1,2)= 1 match(2, 1 )=2 match(2,2)=2 ELSE IF num_moml=l AND num mom2=2 THEN ! b=l mom I child, t=2 mom MAT REDIM match(l,2) match(l,l)=l match( I ,2)=1 ELSE IF num moml=2 AND num_mom2=1 THEN ! b=2 mom, tl mom I child MAT REDIM match(l,2) match( I ,1 )= I
match(l ,2)=1 ELSE IF num_moml=2 AND num_mom2=2 THEN ! b=2 mom, t 2 mom MAT REDIM match(2,2) match( I ,1 )= I
match( 1 ,2)=1 match(2, 1 )=2 match(2,2)=2 END IF
n=ubound(match, I ) MAT REDIM temp(n,2) MAT ~ lldllll MAT REDIM match(2*n,12) countO
FOR i=n TO I STEP -I ! make match(2*n,12) bot=temp(i, I ) lv~ (i,2) Cvu~ OU~Il+ I
FORj=l TO 12 match(count,j)=a I (bot,j) NEXT j count=count+ I
FORj=l TO 12 match(count,j)=a2(top,j) NEXT j NEXT i END SUB

! *~*#*********************
! Subluulille~ ptx_to_match - !*************************
S~nB ptx_to_match(name$,file_m~m,m~trh(,)) !i,i,o ! match bot and top loop reading ptx file ! name$: object name CA 022~0822 1998-10-01 ! file_num: point file num. (file num).pt for bot (file_num+ 1 ).pt for top ! match(,): (num_lp*2,12) 0 index for blank file ex) match(l,0) for top blank match bot loop (al) and top loop (a2) and store match info match bot index and top index in ascending order match I st Ip(bot)-2nd Ip(top), 3rd lo(bot)-4th Ip(top), etc (start,end,xd,yd,xu,yu,xl,yl,xr,yl in~.x ,nnm_child) DIM bot(O,O),top(0,0) CALL relate_loop(name$,fi1e_num,bot(,),num moml ) ! i,i,o CALL relate_loop(name$,file_num~ I ,top(,),num_mom2) ! i,i,o CALL screen_child(bot(,),num moml) ! i/o,i CALL screen_child(top(,),num_mom2) ! i/o,i CALL match_2_100p(bot(,),top(,),num_moml ,num_m- m? m~trh(,)) ! i,l,i,i,o END SUB
!*********************
! End of File !*********************

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 !********************************************************************
! Written by Cheol Lee ! File: 72-5-ct2.tru ! Date: 6/96 ! Object: Make cut file reading point file ! Input: *.pt, *.ptx ! Output: *.ct, *.ctx !********************************************************************
! MENO
! - *.ctx: 13 rec for each match loop, and 5 rec at the end (start num of cut,end num of cut,xbstart,ybstart,xtstart,ytstart, xmin~xm~x~ymin~ymqx~in~ x-b~index-t~max-angle) ... (xmin~xm~x~ymin~ym~x~m~ angle f'or all match loops) ! - can keep top cross section by reverse_cut_file for better looking slice !********************************************************************
library "71-gct.lru"
library "71-ut.tru"
library "71-S-ctl.tru"
library "utillib 1 .tru"
library "3dlib.trc"
d point=.4 cut angle=40 decimal=4 dh=1 .3 name$="fordcarl "
skip=0 reverse=0 start,end=7 clear !call cut_report(name$,19,1,40,2,2,2,2,12,12,12,1,1,2,19) !call read_cut_report(name$) call auto_cut(name$,start,end,reverse,dh,cut_angle,decimal,skip) end EXTERNAL
!*********
! Summary (72-5-ct2) *~*
SUB point to_array(#l,start,end,a(,)) ! .,o SUB find_closest_pt(a(,),xi,yi,index,xo,yo) ! .,o,o,o SUB resort_array(a(,),index) ! i/o~i SUB cutter_position(d_allowed,decimal,x I ,y I ,x2,y2,x2_cut,y2_cut) ! .,o,o ! SUB cut_a loop(#l,#? c~ip,ct~lrt_b,end_b,start t,end t,&
& xls,yls,x2s,y2s,dh,cut_angle,decimal,#5,#6) ! ..,o SUBreverse_cut_file(#1,#2) ! i,i ! SUB point_to_cut(name$,~11e_num,reverse,dh,cut_angle,decimal,skip,&
& xsize,ysize,max_angle) ! i/o,i.,o,o,o ! SUB auto_cut(name$ start,end,reverse,dh,cut_angle,decimal,skip) ! SUB cut_a loop_sml(#l,start_b,end_b,index_b,decimal,#5,#6) ! SUB point to cut_sml (n~m~ file_num,decimal) ! SUB auto cut_sml(name$,start,end,decimal) CA 022~0822 1998-10-01 !***~ *************~*
! Sul~-o~ e. point_to_array l***************************
SUB point_to_array(#l,start,end,a(,)) ! i,i,i,o ! copy a loop pt coord in array.
! start,end: start and end pt num for a loop first pt and last pt are same bc it is a loop ! a(,): point array for a loop, a(num_pt,2 {x,y}) num_pt=end-start+ I
MAT REDIM a(num_pt,2) rec_sla~ lal 1~2-1 RESET #l :record rec_start FOR i=1 TO num_pt READ #l:x,y a(i,l)=x ! shift a(i,2)=y NEXT i END SUB
!***********************~ **
! Su~routine: find_closest_pt !*****************************
SUB find_closest_pt(a(,),xi,yi,index,xo,yo) ! i(3),o(3) ! find closest pt in a(,) from (xi,yi) ! a(,): point array for a loop, a(num_pt,2{x,y}) ! xi,yi: a point to calculate distance from ! xo,yo: closest point in a(,) from xi,yi ! index: index in a(,) for (xo,yo) num_pt=ubound(a, 1 ) d_min=1000000 ! init index=0 ~OR i=1 TO num~t x=a(i, 1 ) y=a(i,2) d=(xi-x)~2~(yi-y)~2 IF d~=d_min T~IEN
index=i xo=x yo=y d_min=d END IF
NEXT i END SUB
!***************************
! Subloulille. resort_array !***************************
SUB resort_array(a(,),index) ! i/o,i ! sort a(,) to have index pt comes first. copy I st pt at last.
! this is cut order from 1 to end ! a(,): point array for a loop, a(num~t,2 {x,y~ ) CA 022~0822 1998-10-01 ! index: start point index in a(,) IF index=l THEN Exit sub ! if index=l, original array DIM temp(0,0) num_pt=ubound(a, l ) MAT REDIM temp(num pt,2) count=0 FOR i=index TO num_pt- 1 ! remove last pt. last pP first pt CUUU~ JUIII I I
temp(count, I )=a(i, l ) temp(count,2)=a(i,2) NEXT i FOR i=l TO index count=count+ l temp(count, l )=a(i, l ) temp(count,2)=a(i,2) NEXT i MAT a=temp END SUB
!*****************************
I Sul"uuli~-e. cuKer position !*****************************
Sl)B cuner_position(d_allowefl ~erim~l xl,yl,x2,y2,x2_cut,y2_cut) !i(6),o(2) ! Find actual cuner position satisfying cuner length allowed ! If distance is over max, keep bot point and move top at max distance ! d_allowed : distance allowed bw top and bot in top view ! decimal : round decimal for cut point (i,..,o,o) ! xl,yl,x2,y2: bot, top m -t~hinp point, start points from point file ! x2_cut,y2_cut: top point satisfying distance re-~uuu.-l. nt d=((xl-x2)~2+(yl-y2)~2)~0.5 ! distance of calculated point ! find actual cuner position IF d>d_allowed THEN
m=d_allowed n=d-d_allowed x2_cut=(m*x2+n*xl)/d ! m:n ratio int~,se.,1iu-- of xl and x2 y2_cut=(m*y2+n*yl )Id x2_cut=round(x2_cut,decimal+ l ) y2_cut=round(y2_cut,decimal+ l ) ELSE
x2-cul-~ou.ld(x2~decimal+ 1 ) y2_cut=round(y2,decimal+ l ) END IF
END SUB
!*#*~*******************~*
! Subroutine: cut_a_loop !*************************
SUB cut_a_loop(#l,#7 cl~ir,5t~rt_b,end_b,start_~,end_t,index_b,index_t,&
& xls,yls,x2s.y2s,dh,cut_angle,decimal,#5,#6) ! i,..,o,o CA 022~0822 1998-lO-01 W O 97/37317 rcTrusg7/o54l9 .-! find cut path for a match loop.
! #I,start_b,end_b: bot pt file channel, rec num of a loop ! #2,start t,end_t,: top pt file channel, rec num of a loop ! #5,#6: output cut file, *.ct, *.ctx ! skip : num of pt to skip ! index_b,index_t: index for bot and top match loop ! xls,yls,x2s,y2s: bot and top first point of a match loop ! dh,cut_P l~lP,d~cimal: foam thi~n~s~ max cut angle. round decimal ! *.ctx: 13 rec for each match loop, and 5 rec at the end ~start num of cut,end num of cut xhstP~t,ybstart,xtstart,ytstart, ~min,xm~x,ymin,ym~x in~ x_b,index_t,max_angle) ! ~ ... (xmin ~m:lx,ymin,ym:lx,m~x_angle for all match loops) DIM b(0,0),t(0,0) CALL point_to_array(#l ,start_b,end b,b(,)) ! .,o CALL point_to_array(#2,start t,end t,t(,)) ! .,o xb=b(l,1) ! bot start pt yb=b(l ,2) CALL find_closest pt(t(,),xb,yb,index,xt,yt) ! .,o,o,o CALL resort array(t(,),index) ! i/o,i cut path is from I to end d_allowed=dh*tan(cut_angle*pi/180) ! distance allowed bw top and bot in top viewnum_b=ubound(b, I ) ! num of pt num_t=ubound(t, I ) xls=b(l,l) ! first pt yls-b(1,2) x2=t(l,l) y2=t( 1,2) CALL cutter_position(d_allowed,decimal,x I s,y I s,x2 ,y2,x2s,y2s) RESET #S:end ASK #5:record rec_start WRITE #6:rec_start WRITE #5:xls,yls,x2s,y2s ! save start cut pos bn=l ! current counter tn=l DO ! cut all pt on a loop FOR i=l TO skip! skip n points IF bn<num b THEN! read bot x I =b(bn+ I, I ) yl=b(bn+1,2) bn=bn+l END IF
IF tn<num_t THEN! read bot x2=t(tn+l,l) y2=t(tn+l ,2) tn=tn+l END IF
NEXT i IF bn>=num b THEN! read bot xln=b(num_b, I) yln=b(num_b,2) ELSE
xln=b(bn+l,l) yln=b(bn+l ,2) END IF

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 IF tn>=num t THEN ! read top x2n=t(num_t, 1 ) y2n=t(num_t,2) ELSE
x2n=t(tn+l ,1) y2n=t(tn~1 ,2) END IF
!-- compare distance d_boP(xln-x2)~2+(yln-y2)~2 ! if move bot point d_top=(x2n-xl)~2+(y2n-yl)~2 ! if move top point d_both=(xln-x2n)~2+(yln-y2n)~2 ! if move both point CALL min3(d_bot,d_top,d_both,d min) IF tn>=num_t and bn>=num_b THEN
d_min=d_both ELSE IF tn>=nurn_t THEN
d_min=d bot ELSE IF bn>=num_b THEN
d min=d_top END IF
IF d_min=d_both THEN ! move both xl=xln yl=yln x2=x2n y2=y2n bn=bn+ I
tn=tn+ I
ELSE IF d min=d_top THEN ! move top x2=x2n y2=y2n tn=tn+l ELSE ! move bot xl=xln ! update yl=yln bn=bn+ I
END lF
CALL cutter position(d_allowed,decimal,x I ,y 1 ,x2,y2,x2_cut,y2_cut) WRITE #S:xl,yl,x2 cut,y2_cut LOOP UNTIL bn>=num b AND tn> num_t WRITE #5:xls,yls,x2s,y2s !copy start pos at last RESET #5:end ! end rec num of a lp ASK #5:record rec_new start rec_end=rec new start-l WRITE #6:rec end num_ct=(rec end-rec_start+ l )/4 xrnin,ymin=1000 ! init xmax,yn~q~ m ~x=_1000 RESET #5:record rec_start FOR i=l TO num ct READ #5:xl,yl,x2,y2 if x1>1000 or yl>l000 or x2>1000 or y2>1000 then print xl,yl,x2,y2 print num_ct,i end if IF xl<xm.in THEN xmin=x 1 IF yl~ymin THEN ymin=yl IF x2~xmin THEN xmin=x2 IF y2~ymin THEN ymin=y2 IF xl~xmax THEN xmax=xl IF y I >ymax THEN ymax=y 1 IF x2>xmax THEN xmax=x2 IF y2>ymax THEN ymax=y2 d=((xl-x2)~2+(yl-y2)~2)AO.S
IF d>dmax THEN dmax=d NEXTi t mn xm:l .prm x 1, x,ymm,ymax max_angle-atn(dmax/dh)* 1 80/pi WRITE #6:xls,yls,x2s,y2s WRITE #6 xmin xm~x,ymin,ymax WRITE#6:index b,index_t,max_angle END SUB
!******************
! reverse_cut_file !******************
SUB reverse_cut_file(#l ,#2) ! i/o,i/o ! change top and bot record in *.ct, and *.ctx ! keep top shape and cut bot at max cut angle ! #1, #2: *.ct, *.ctx channel ASK #1: filesize num_rec_ct ASK #2: filesize num_rec_ctx num_ct=num_rec_ct/4 num match=(num_rec_ctx-5)/13 FORi=l TO num_ct rec=(i- 1)*4+ 1 RESET #I:record rec READ #I:xl,yl,x2,y2 RESET #I:record rec WRITE #I:x2,y2,xl,yl NEXTi FORi=l TO num_match rec=(i-1)*13+1 RESET #2:record rec READ #2:start,end,xls,yls,x2s,y2s,xl,x2,yl,y2,indexl,in-1Px7,:~ngle RESET #2:record rec WRITE #2:start çn-~ x~c y2s~xls~yls~xl~x2~yl~y~in~lpx~ in~1Pxl,angle NEXTi END SUB
!************************~*
! Sul~ruulh~c; point_to_cut l**************************

CA 022~0822 1998-10-01 SUB point to_cut(name$,fi1e_num,reverse,dh,cut_angle,~Pçim~ ir,&
& xsize,ysize,max_angle) ! i,..,o(3) ! Find multi loop cut path by moving point to point ! name$: object name ! reverse: 0=no reverse, defaule, keep bot cross section I=reverse, keep top cross section ! dh,cut angle,decimal: foam ll.;f L".~, max cut angle, round decimal ! skip: num of pt to skip to go to next pt to cut ! x,ysize,max_angle: max x and y and angle for a layer(all loops) DIM match(0,0) file ct$="object\" & name$ & "\" & str$(file num) & ".ct"
file_ctx$="object\" & name$ & "\" & str$(file_num) & ".ctx"
IF reverse=0 THEN
file_pt b$="object\" & name$ & "\" & str$(fi1e_num) & ".pt"
file pt_t$="object\" & name$ & "\" & str$(file_num+1) & ".pt"
ELSE
file_pt b$="object\" & name$ & "\" & str$(file_num~1) & ".pt"
file pt_t$="object\" & name$ & "\" & str$(file_num) & ".pt"
END IF
CALLopen_file(#l,file pt_b$,error) IF error= I THEN exit sub CALL open file(#2,file_pt_t$,error) IF error=l THEN exit sub OPEN #5:name file_ct$,access Outin,create Newold,org record ERASE #5 SET#5:Recsize 10 OPEN #6:name file ctx$,access Outin,create Newold,org record ERASE #6 SET #6:Recsize 10 CALL ptx_to_match(name$,file_nl-m m~tch(,)) ! ,o num l~tcll-uboulld(match, l )/2 FOR i=l TO num match IF reverse=0 THEN
start b=match(i*2- 1, I ) end_b=match(i*2- 1 ,2) start_t=match(i*2, 1 ) end_~ latch(i*2,2) index b=match(i*2-1,11) index_~-nlatch(i*2,1 1) ELSE
start_~ atch(i*2- 1, I ) end~ atch(i*2- 1,2) start_b=match(i*2, 1 ) end b=match(i*2,2) index_l-lllatch(i*2-1,1 1) index_b=match(i*2,1 1) END IF
CALl.cut_a loop(#l~#2~c~ir~ct~rt-b~end-b~start-t~end-t~index-b~index-t~&

WO 97/37317 PCT/US97/05419 . -& xls,yls,x2s,y2s,dh,cut angle ~1rcim~l #5,#6) ! .o,o NEXT i ASK #6:fi1esize fsize num_lna~ r~ 3 xmin,yr~un= l 000 xmax,ym~x ,mqx_angle=- l 000 RESET #6:begin FOR i=l TO num_match ! find slice size and max angle READ #6:start,end,xls,yls,x2s,y2s,xl,x2,yl,y2,indexl,in~1ex~,~ngle IF xl<xmin THEN xmin=xl IF yl<ymin THEN ymin=yl IF x2~xmin THEN xmin=x2 IF y2~ymin THEN ymin=y2 IF xl>xmax THEN xmax=xl IF yl>ymax THEN yrnax=yl IF x2>xmax THEN xmax=x2 IF y2>ymax THEN ymax=y2 IF angle>max_angle T~EN max_angle=angle NEXT i ASK #5:filesize fsize num_cut=fsize/4 max_angle=round(max angle, l ) WRITE #6 xmin,xm lx,ymin,ym~-r m~x_angle IF reverse<>0 THEN CALL reverse_cut_file(#5,#6) ! i,i ~-si~ ax-xmin ysize=ymax-ymin PRINT num_cut;"cuts in ";str$(file_num);".ct"
PRlNT "Slice size x/y: ";xsize;"/";ysize PRINT "Max angle is";max_angle;"degree."
CLOSE #l CLOSE #2 CLOSE #5 CLOSE #6 END SUB
!~*~****~*
! auto_cut !~*~*~****
SUB auto-cut(n~mr$ ct~rt~end~reverse~&~cut-angle~1f rim~l Cl-jp) ! i,..
! cut from start tod end cut file num ! name$: object name ! start,end: start and end file num *.ct ! reverse: 0=no reverse, defaule, keep bot cross section I=reverse, keep top cross section ! &,cut_~nglr,decim ~1: foam thickness, max cut angle, round decimal ! skip: num of pt to skip to go to next pt to cut FOR i=start TO end ! create all loop files pRINT
PRINT "Making file ";str$(i);".ct";" (";i;"/";end;"). Wait.."
CALLpoint_to_cut(name$,i,reverse,dh,cut angle,decimal,skip,&
& xsize,ysize,max_angle) ! i/o,i.,o,o,o NEXT i CA 022~0822 1998-10-01 PRINT end-start+ I ;"files are made. "
END SUB
!*~*****************~****~**
! Subroutine: cut_a_loop_sml !*****~*~*****~**************
SUB cut_a_loop_sml (#1 ,start_b,end_b,index_b,decimal,#5,#6) ! i,..,o(2) ! find cut path for a loop for sml, vertical cylindrical shape ! #l,start b,end_b: bot channel, rec num of a loop ! index_b,decimal: index of bot. round decimal ! #5,#6: *.ct, *.ctx ! *.ctx: 13 rec for each match loop, and 5 rec at the end (start num of cut,end num of cut,xbstart,ybstart,xtstart,ytstart, xmin xm~x~ymin~ym~y infl~x b,index_t,max_angle) ... (xmin~xm~x~ymin~ymqx~m~x-angle for all match loops) DIM b(0,0) CALL point_to_array(#l ,start_b,end_b,b(,)) ! .,o num_b=ubound(b, I ) ! num of pt RESET #5:end ASK #5:record rec start WRITE #6:rec_start FOR i=l TO num_b xl=b(i,l) yl =b(i,2) WRITE #5:xl,yl,xl,yl ! save start cut pos NEXT i xls=b(l,l) yls=b(1,2) WRITE #5:xls,yls,xls,yls ! save start cut pos RESET #5:end ! end rec num of a lp ASK #5:record rec_new_start rec_end=rec_new start-l WRITE #6:rec end num ct=(rec_end-rec_start+ l )/4 xmin,ymin=1000 ! init xmax,ymax,dmax=- 1 000 RESET #5:record rec_start FOR i=l TO num ct READ #5:xl,yl,x2,y2 IF xl<xmin THEN xmin=xl IF y l <ymin THEN ymin=yl IF x2<xmin THEN xrnin=x2 IF y2<ymin THEN ymin=y2 IF xl>xmax THEN xmax=xl IF yl>ymax THEN yrnax=yl IF x2>xmax THEN xmax=x2 IF y2>ymax THEN ymax=y2 d=((xl-x2) 2+(yl-y2) 2) 0.5 IF d>dmax THEN dmax=d NEXT i WRITE #6:xls,yls,xls,yls WRITE #6 xmin~xm~x ymin~ymax WRITE #6:index_b,index_b,max_angle END SUB

CA 022~0822 1998-10-01 - W O 97/37317 PCT~US97/05419 !******************************
! Subroutine: point to_cut_sml !********************~********
SUB point to cut_sml(name$,file_num,decimal) ! i,i,i ! make cut file for sml ~ name$: object name ! file_num: cut file num ! decimal: round decirnal for *.ct DIM match(0,0) file_ct$="object\" & name$ & "\" & str$(file_num) & ".ct"
file ctx$="object\" & name$ & "\" & str$(file_num) & ".ctx"
file~t$="object\" & name$ & "\" & str$(file_num) & ".pt"
CALL open_file(#l,file_pt$,error) IF error 1 THEN exit sub OPEN #5:name file_ct$,access Outin,create Newold,org record ERASE #5 SET #5:Recsize 10 OPEN #6:name file_ctx$,access Outin,create Newold,org record ERASE #6 SET#6:Recsize 10 CALL ptx_to_match(nqn-~$ file_m-m,mqtrh(,)) ! ,o num_,--al l.-ul,uund(match,1)/2 FOR i=l TO num_match start_b=match(i*2- 1, I ) end b=match(i*2-1,2) start_t=match(i*2, 1 ) end_t=match(i*2,2) index_b=match(i*2- 1, I 1 ) index_t=match(i*2, 11 ) CALL cut_a_loop_sm I (# l ,start_b,end b,index_b,decimal,#5 ,#6) NEXT i ASK #6:filesize fsize num Illalc~ ~ell3 xmin,ymin=1 000 xmax,ymqx mqx_angle=-1000 RESET #6:begin FOR i=l TO num_match ! find slice size and max angle READ #6:start,end,x I s,y 1 s,x2s,y2s,x 1 ,x2,y 1 ,y2 ,index 1 ,index2,angle IF xl<xmin THEN xmin=xl IF y 1 <ymin THEN ymin=y 1 IF x2<xmin THEN xmin=x2 IF y2<ymin THEN ymin=y2 IF xl>xmax THEN xmax=xl IF y l >ymax THEN ymax=y I

CA 02250822 l998-lO-Ol - W O 97/37317 PCT~US97/05419 .-IF x2>xmax THEN xmax=x2 IF y2>ymax THEN ymax=y2 IF angle>max_angle THEN max_angle=angle NEXT i ASK #5:filesize fsize num_~ r~ ;/4 max_angle=round(max_angle, I ) WRITE #6 xmin~xm~x~ymin~ym~x~max_angle xs.~ xmin ysize=ymax-ymin PRINT num_cut;"cuts in ";str$(file_num);".ct"
PRINT "Slice size x/y: ";xsize;"/";ysize PRINT "Max angle is";max_angle;"degree."
CLOSE #l CLOSE #5 CLOSE #6 END SUB
!**************
! auto cut_sml !****~*********
SUB auto_cut_sml(nam~ $,ctS~rt,end,decimal) ! i(4) ! make cut file from start to end ! name$: object name ! start,end: start and end cut file num ! decimal: round decimal FOR i=start TO end ! create all loop files PRINT
PRINT "Making file ";str$(i);"~ct";" (";i;"/";end;"). Wait.."
CALL point_to_cut_sml(name$,i,decimal) NEXT i PRINT end-start+l;"files are made. "
END SUB
!*************
! End of File !*********~***

CA 022~0822 1998-10-01 - W O 97/37317 PCT~US97/05419 !*******************************************************************
! Written by Cheol H. Lee ! File: 72-6-st.tru ! Date: 6/96 ! Object: make step file reading cut file ! Input: *.ct, *.ctx ! Output: *.st text file !*************~*****************************************************
! M E M O
! - *.st file is text file to be read by C program ! - *.st file includes registration holes, and access and return path to reg holes.
!~*~$~***********************************************************
library "71-ut.tru"
library "71-gct.tru"
library "utillib.tru"
library "3dlib.trc"
name$="carbody"
start,end=6 num_hole=2 dh=2.5 space_b=l .3 space_t=l .2 d_point=0. 1 xh=0 yh=2 x 1 s,x2s,y2s=800 yls=120.63 skip=2 x2w,y2w=130 !clear call auto_step(name$,start,~nfl n--m_ho'~,-1h cpare b,space_t,&
& d_point cl ip xh yh,xIs,x2s,yIs,y2s) call draw_auto_st_3d(nS~mf~$ ct~rt,end,dh,space_b,space_t,x2w,y2w,x I s,x2s,y I s,y2s,xh,yh) end EXTEFUNAL
~ *~
! Summary (72-6-st) !*********
SUB slide~os(r_bot,r_top,xs,ys,xls,x2s,yls,y2s,xl,x2,yl,y2,#5) ! ..o SUB access_path(r_bot,r_top,d~oint,skip,x l s,x2s,y l s,y2s, &
& xlf,x2f,ylf,y2f,xlt,x2t,ylt,y2t,#5) ! ..o ! SUB find_closest_cut_num(#l,x,y,choice,cut_num,xlc,ylc,x2c,y2c) ! SUB find_hole_start(#l,num_hole,hole(,)) ! SUB hole circle(hole(,),hole_num,r_bot,r_top,d~oint,xl s,x2s,yl s,y2s,&
& xlf,x2f,ylf,y2f,xs,ys,#5) ! SUB cut-to-step(n~mlo$~fil~-nllm~nllm-hole~hole(~)~Ah~cp~ce-b~space-t~&
& d_point cl~jp xh,yh,xls,x2s,yls,y2s) ! SUB auto step(n~ ct~rt,end,num_hole,dh,space_b,space_t,&
& d~oint c~ ip,xh yh,xls,x2s,yls,y2s) t~******"~******
! Sul)~u.ltilIe. slide pos t ~ ,,,****

CA 022~0822 1998-10-01 - W O 97/37317 rCT~US97/05419 SUB slide_pos(r_bot,r_top,xs,ys,x I s,x2s,y I s,y2s,x 1 ,x2,y 1 ,y2,#S) ! i,. .,o ! convert pos of cut file into abs step pos of slide with shift ! r_bol-~ace_b/dh, r~ s~ace_t/dh ! xs,ys: shift xnew=xold+xs.
- ! xl,x2,yl,y2: coord in ct file ! xls,y ls: num steps for bot / cm ! x2s,y2s: num steps for top / cm ! #5: *.st channel, abs step po xla=xl-(x2-xl)*r_bot ! slide pos w/o shift x2a=x2+(x2-x 1 )*r top yla=yl-(y2-yl)*r bot y2a=y2+(y2-y 1 )*r_top xla=xla+xs ! shift x2a=x2a+xs yla=yla+ys y2a=y2a+ys xlsa=int(xla*xls) ! slide abs coord in step x2sa=int(x2a*x2s) ylsa=int(yla*yl s) y2sa=int((y2a-y 1 a)*y2s) PRINT #5:xlsa PRINT #5:ylsa PRINT #5:x2sa PRINT #5:y2sa END SUB
!***~****~*******************
! Subroutine: slide_pos_point !****~************************
SUB slide pos_point(r_bot,r top,d_point,skip,xls,x2s,yls,y2s, &
& xlf,x2f,ylf,y2f,xlt,x2t,ylt,y2t,xs,ys,#5) ! i,..,o ! divide a line with d_point and skip n point ! r_bot=space_b/dh, r t~ .acc_t/dh ! d_point,skip: distance bw points, num of points to skip ! xls,yls,x2s,y2s: bot and top ratio for motors steps/cm ! xlf,x2f,ylf,y2f: abs coord of start point of a line in cm ! xlt,x2t,ylt,y2t: abs coord of end point of a line in cm ! xs,ys: shift xnew=xold+xs.
! #5: step file. *.st dxl=xlt-xlf ! dis bw each coord dx2=x2t-x2f dyl=ylt-ylf dy2=y2t-y2f d_bot=(dxl~2+dyl~2~~0.5 d_top=(dx2~2+dy2A2)AO.5 d=max(d_bot,d_top) ! fmd max dis bw top and bot ~ IF d=0 THEN exit sub d_p=d_point*(skip+l) ! new d_point with skip num_pPint(d/d_p) ! num of pt on a line IF num pt oO THEI~' ! dis ill~lc~ nl in cm ddxl=dxl/num_pt _ ddx2=dx2/num Qt ddy I =dy 1/num_pt ddy2=dy2/num_pt FOR i=l TO num_pt ! cal step size and save xl=xlf+ddxl*i ! coord to go in cm x2=x2f+ddx2*i yl=ylf+ddyl*i y2 =y2f+ddy2 i' i CALL slide_pos(r_bot,r top,xs,ys,x 1 s,x2s,y I s,y2s,x 1 ,x2,y 1 ,y2 ,ff5 ) ! . .o NEXT i END IF
CALL slide_pos(r bot,r top,xs,ys,xls,x2s,yls,y2s,xlt,x2t,ylt,y2t,#5) ! ..o END SUB
!************************
!SUbIOUI~IC: access_path !************************
SUB access path(r_bot,r_top,d_point,skip,xls,x2s,yls,y2s, &
& xl f,x2f,yl f,y2f,x It,x2t,yl t,y2t,#5) ! i,..,o ! access path from xf to xt ! r bot=space_b/dh, r_top=space_t/dh ! dQoint,skip: distance bw points, num of points to skip ! xls,yl s,x2s,y2s: bot and top ratio for motors stepslcm ! xl f,x2f,yl f,y2f: abs coord of start point of a line in cm ! xlt,x2t,ylt,y2t: abs coord of end point of a line in cm ! #5: step file. *.st xs,ys=O
CALL slide pos_point(r bot,r top,d_point,skip,x 1 s,x2s,y 1 s,y2s, &
& xlf,x2f,ylf,y2f,xlf,xlf,0,0,xs,ys,#5) ! ..o CALL slide_pos point(r_bot,r_top,d~oint,skip,xls,x2s,yls,y2s, &
& xlf,xlf,O,O,xlt,xlt,O,O,xs,ys,#5) ! ..o CALL slide_pos_point(r_bot,r_top,d point,skip,x 1 s,x2s,y I s,y2s, &
& xlt,xlt,O,O,xlt,x2t,ylt,y2t,xs,ys,#5) ! ..o END SUB
!***~tt~t~tt~**************
!SUbIUUlUIC:fmd-C1OSeSt-CUt-nUm !*********************************
SUB find_closest_cut_num(#l,x,y,choice,cut num,xlc,ylc,x2c,y2c) ! i(4),o(5) ! find closest cut num from a point (x,y) ! #1: cut file. *.ct ! x,y: point to find crosest point from ! choice: access direction 1=0 deg, 2=90 deg, 3=180 deg,4=270 deg, O=min dis ! cut_num: cut num in cut file.
! xlc,ylc,x2c,y2c: cut record ASK #I:filesize num_rec num_cuP(num rec-5)/4 cut_num=O
dmin=l 0000 RESET #I:Begin READ # I :x I old,y 1 old,x201d,y201d FOR i=2 TO num_cut READ #l:xl,yl,x2,y2 CA 022~0822 1998-10-01 xsign=(x-xl)*(x-xlold) ysign=(y-yl )*(y-y I old) d=(x-x1)~2+(y-yl)~2 dy=abs(yl -y) dx=abs(x I -x) IF choice=0 THEN
IF d<dmln THEN
dmin=d cut num=i END IF
ELSE IF choice=l THEN
IF ysign~=0 and x<=xl and dx<dmin THEN
dmin=d cut_num=i ENDIF
ELSEIF choice=2 THEN
IF xsign<=0 and y<=yl and dy<dmin THEN
dmin=d cut num=i ENDIF
ELSEIF choice=3 THEN
IF ysign<=0 and x>=x I and dx<dmin THEN
dmin=d cut num=i ENDIF
ELSE IF choice=4 THEN
IF xsign~=0 and y>=y I and dycdmin THEN
dmin=d cut_num=i ENDIF
ENDIF
IF cut_num=i THEN
XIC=XI
x2c=x2 ylc=yl y2c=y2 ENDIF
xlold=xl x201d=x2 ylold=yl y201d=y2 NEXTi ENDSUB
!************************************
! Subroutine: find hole_start !**********~*************************
SUB find_hole_start(#l,num_hole,hole(,)) ! i,i,i/o ! find cut_num, rad start for all holes.
! #1: cutfile, *.ct.
! nurn_hole: num of regictr~tic n holes ! hole(,): reg hole info array. hole(num of hole,7) (choice,xc,yc.radi,cut_num,rad start,resolution) ! choice: access direction CA 022~0822 l998-lO-Ol W O 97/37317 PCTrUS97/05419 1=0 deg, 2=90 deg, 3=180 deg,4=270 deg, 0=min dis ! xc,yc : center of reg hole ! radi : radius of reg hole ! cut_num: cut num of access pos in cut file ! rad start: access radian to start to cut a hole ! resolution: num of points for a reg hole ASK #l :filesize num rec num cut=(num_rec-5)/4 FOR i=l TO num_hole choice=hole(i, I) xc=hole(i,2) yc=hole(i,3) radi=hole(i,4) IF choice=l THEN ! start 0 deg rad_start=0 x=xc+radi y=yc CALL find_closest cut_num(#l ,x,y,choice,cut num,xlc,ylc,x2c,y2c) ELSE IF choice=2 THEN ! start 90 deg rad_sta~ il2 x=xc y=yc+radi CALL find_closest_cut num(#1 ,x,y,choice,cut num,x I c,y I c,x2c,y2c) ELSE IF choice=3 THEN ! start 180 deg rad start=pi x=xc-radi y=yc CALL find_closest cut_num(# I ,x,y,choice,cut_num,x I c,y 1 c,x2c,y2c) ELSE IF choice=4 THEN ! start 270 deg rad stal l-~i* 1.5 x=xc y=yc-radi CALLfind_closest_cut num(#l,x,y,choice,cut_num,xlc,ylc,x2c,y2c) ELSE IF choice=0 THEN ! closest from xc,yc x=xc y=yc CALL find_closest cut_num(# I ,x,y,choice,cut_num,x I c,y 1 c,x2c,y2c) dx=xlc-xl dy=ylc-x2 IF dx=0 THEI~
PRINT "Hole is outbound."
GET KEY key Exit sub ELSE
rads=atn(abs(dy/dx)) END IF
IF dx>=0 and dy>=0 THEN
rad_start=rads ELSE IF dx<-0 and dy>=0 THEN
rad_sta~ rads ELSE IF dx<=0 and dy<=0 THEN
rad_~ ,i I rads ELSE IF dx>=0 and dy<=0 THEN
rad_start-2~pi-rads END IF
END IF

CA 022~0822 1998-10-01 W O 97/37317 PCTrUS97/05419 ..

hole(i,5)=eut_num ! save info hole(i,6)=rad_start NEXT i END SUB
!************************
! Subroutine: hole_eircle !******~***************~*
SUB hole_circle(hole( ,),hole_num,r bot,r_top,d point,x I s,x2s,y 1 s,y2s,&
& x I f,x2f,y I f,y2f,xs,ys,#5) ! i,. .,o ! calculate all pt and step for a hole and save in *.st f~le ! hole(,): reg hole info array. hole(num of hole,7) (~hoirl xc,ye,radi,eut_num,rad_start,resolution) ! hole_num: hole num in hole(,) ! r_boPspaee_b/dh, r_top=space_t/dh ! d point: distance bw points ! xls,yls,x2s,y2s: bot and top ratio for motors steps/em ! xlf,x2f,ylf,y2f: abs eoord of start point of a line in cm ! xs,ys: shift in x,y direction ! #5: step file *.st choiee=hole(hole_num, 1 ) xc=hole(hole_num,2) yc=hole(hole_num,3 ) radi=hole(hole_num,4) cut_num-hole(hole_num,5) rad_start=hole(hole_num,6) resolution=hole(hole_num,7) !

! aecess hole x start=xe+eos(rad_start)*radi ! start pt on a hole y_~ldll-y~, I sin(rad_start)*radi CALLslide pos_point(r bot,r top,d~oint,skip,xls,x2s,yls,y2s,&
& x 1 f,x2f,y I f,y2f,x_start,x_start,y_start,y_start,xs,ys,#5) !----! cut hole drad=2*pi/resolution nl=int((2*pi-rad_start)/drad) ! num of pt on a arc from rad_start to 2pi n2=int(rad_start/drad) ! num of pt on a arc from 0 to rad_start FOR i=l TO nl ! eut angle from rad_start to 2*pi rad=rad_start+i*drad xouPxc+cos(rad)*radi youPye+sin(rad)*radi CALL slide_pos(r_bot,r_top,xs,ys,x 1 s,x2s,y 1 s,y2s,&
& xout,xout,yout,yout,#5) NEXT i xouPxc+radi ! path 0 deg pt CALL slide_pos(r_bot,r_top,xs,ys,x I s,x2s,y I s,y2s,xout,xout,yc,yc,#5) FOR i=l TO n2 ! eut angle from 0 to rad_start rad=i*drad xout=xe+eos(rad)*radi ~,vut ~ 1 si,.(rad)*radi CALLslide pos(r_bot,r_top,xs,ys,xls,x2s,yls,y2s,xout,xout,yout,yout,#5) NEXT i ! pass start point CALL slide_pos(r_bot,r_top,xs,ys,xls,x2s,yls,y2s,x_start,x_start,y_start,y_start,#5) CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/05419 !

! return to loop CALL slide pos_point(r_bot,r_top,d_point,skip,x I s,x2s,y I s,y2s, &
& x_start,x_starl,y_start,y_start,x 1 f,x2f,y I f,y2f,xs,ys,#5) END SUB
!~******#*~**************
! Subroutine: cut to_step !************************
SUB cut to_step(name$,file_nnm,nl-m_hole,hole(,),llh epa~e_b,space_t,&
& d_point,skip,xh,yh,x I s,x2s,y I s,y2s) ! all input ! read cut file and make step file including access path, return path, ! and registration holes ! name$: object name ! file_num: file num for *.ct, ~.st ! nurn_hole: num of reg hole ! hole(,): reg hole info array. hole(num of hole,7) (choice,xc,yc,radi,cut num,rad_start,resolution) ! &,d point: foam thi~kn~cs, distance bw points ! space_b,space_t: distance bw top and bot control point and the foam ! skip: num of point to skip ! xh,yh: x and y home position ! xls,yls,x2s,y2s: bot and top ratio for motors steps/cm file_ct$="object\" & name$ & "\" & str$(file_num) & ".ct"
file_ctx$="object\" & name$ & "\" & str$(fi1e_num) & ".ctx"
file_st$="object\" & name$ & "\" & str$(file_num) & ".st"
CALL open_file(#l,file_ct$,error) IF error=l THEN exit sub CALL open_file(#2,file ctx$,error) IF error- I THEN exit sub OPEN #S:name file_st~,qccecc outin, create newold, org text ERASE #5 ASK #2:filesize num_rec RESET #2:record num_rec-4 READ #2 xmin,xm~x,ymin,ymqx,~n~1e RESET #2:begin num_match=(num rec-5)/13 r_bot=space_b/dh r_top=space t/dh xs=xh-xmin ! calc shift ys=yh-ymin FOR i=l TO num_match ! find step for all loops IF i=l THEN ! start point xlf,x2f=0 ! first start pos=0 ylf,y2f=0 ELSE
xlf=xlt x2f=x2t ylf=ylt y2f=y2t END IF

READ #2:start,end,xbs,ybs,xts,ytc xmin ~m~ ymin,ym~ in~x b,index_t,angle ! a slice info x l t=xbs+xs x2t=xts~xs ylt=ybs+ys - y2t=yts+ys CALL access~ath(r_bot,r_top,d_point,skip,x I s,x2s,y I s,y2s, &
~ x l f,x2f,y I f,y2f,x l t,x2t,yl t,y2t,#5) ! . .o CALL find_hole_start(# l ,num hole,hole(,)) num ct=(end-start+ 1)/4 RESET ~1 :record start FOR j=l TO nurn_ct READ #l:xl,yl,x2,y2 CALLslide pos(r bot,r_top,xs,ys,xls,x2s,yls,y2s,xl,x2,yl,y2,#5) !..o FOR k=l TO num_hole cut_num=hole(lc,5) IF cut numj THEN
CALL hole_circle(hole( ,),k,r_bot,r_top,d_point,x 1 s,x2s,&
& yls,y2s,xl,x2,yl,y2,xs,ys,#5) END IF
NEXT k NEXT j NEXT i CALL access path(r_bot,r_top,d_point,skip,x l s,x2s,yls,y2s, &
& xlt,x2t,ylt,y2t,0,0,0,0,#5) ! .. o CLOSE #l CLOSE #2 CLOSE #5 END SUB
!**~*********************
! Subluuline: auto_step !**~**~***********~******
SUB auto_step(name$,start,f?n-1 n-lm_hok~l1h ~p~re b,space_t,&
& d_point,skip,xh,yh,xl s,x2s,y l s,y2s) ! make step file from start to end including access path, return path, ! and registration holes ! name$: object narne ! start,end: start and end file num for *.ct, * st ! num_hole: num of reg hole ! dh,d_point: foam thiclfn~c~ distance bw points ! space_b,space_t: distance bw top and bot control point and the foam ! skip: num of point to skip ! xh,yh: x and y home position ! x l s,y l s,x2s,y2s: bot and top ratio for motors steps/cm DIM hole(0,0) IF num_hole<>0 THEN ! make hole(,) MAT REDIM hole(num_hole,7) INPUT PROMPT "radius(cm), resolution(n), alternative(l/0)? " &
& :radi,resol~tion,~lt PRINT
PRINT "choice: 0=min dis, l=0 deg, 2=90 deg, 3=180 deg, 4=270 deg"
PRINT
FOR i= I TO num_hole INPUT PROMPT "Hole "&str$(i)&": choice(0-4),xc,yc? ":choice,xc,yc hole(i,l )=choice W O 97/37317 rCTtUS97tO5419 -hole(i,2)=xc hole(i,3)=yc hole(i,4)qadi hole(i,7)qesolution NEXT i END IF
FOR i=start TO end ! malce step files PRINT
PRINT "Making file ";str$(i);".st";" (";i;"/";end;"). Wait.."
CALL cut_to_step(name$,i,num_hole,hole(,),dh,space_b,space_t,&
& d point Cl~ip,~h yh,x1s,x2s,yIs,y2s) IF alt=l THEN ! alt reg hole FOR j=l TO num_hole IF hole~j, 1 )= I THEN
hole(j, I )=3 ELSE IF hole(j,l)=2 THEN
hole(j, 1 )=4 ELSE IF hole(j, 1)=3 THEN
hole(j, I )= I
E3,SE IF hole(j, 1)=4 THEN
hole(j, I )=2 END IF
NEXT j END IF
NEXT i PRINT end-start+l;"files are made. "
END SUB
!**********#**
! End of file !*************

- W O 97137317 PCTrUS97/05419 !*****#********~**************************************************
! Written by Cheol Lee ! File: 72-gct.tru ! Date: 10/95 ! Object: plot *.ct, *.st and *.ln for registration noles ~ ! Input: *.ct, *.st, *.lp ! Output: 2D or 3D drawing for *.ct and *.st, and drawing for reg holes !********~*~ t*************************
library "71-ut.t u"
library "71-gln.tru"
library "71-5-ctl.tru"
library "utillibl.tru"
library "3dlib.trc"
name$="fordcar"
start,end=6 num_hole=0 dh=2.54/2 space_b,space_t=l d_point=0.2 xh=l yh=l x 1 s,x2s,y2s=800 yls=150 x2w,y2w=50 ! call draw_auto st_3d(n~mP~ .~t:lrt,en-l ~lh ,space_b,space t,x2w,y2w,x I s,x2s,y I s,y2s,xh,yh) !call registration(l,5,50,50) !stop !call draw top_bot_2d(name$,file_num,x2w,y2w) ! stop call draw_auto_cut_2d(name$, 1,1 ,2.74/2,x2w,y2w) ! call registration( I ,10,100,100) end EXTERNAL
! ***~*****
! Summary (72-gct) !#********
! SUB draw_top_bot 2d(file_num,x2w,y2w) SUB draw_cut_3d(n~m--$ filP_n--m -lh ~?w,y2w) ! SUB draw_auto_cut 2d(name$,stan,e,J-l rlh x?w,y2w) SUB draw st_3d(file_num,dh,space b,space_t,x2w,y2w,xl s,x2s,y 1 s,y2s,xh,yh) ! SuB draw_auto_st_3d(n~m- $~ct i7rt~nrl~rlh~pare--h~space-t~x2w~y2w~xls~x2s~yls~y2s~xh~yh) ! SUB registration(start,end,xmax,ymax) !****************************
! Subroutine: draw_top_bot_2d !****************************
SUB draw_top bot_2d(n~m. ~ file_num,x2w,y2w) ! i(4) ! Read *.ct and plot it in 2D
! name$: object name ! file_num: cut coordinate file number, *.ct ! 0,x2w,0,y2w: window size CALL draw_loop(name$,file_num,0,x2w,y2w) CALL draw_loop(name$,file_num+ I ,0,x2w,y2w) END SUB

_ CA 02250822 1998-lo-ol - W O 97/37317 PCT~US97/05419 !~**~*****~**~********~*~*
Sul~louline: draw_cut_3d **~***~***********
SUB draw_cut 3d(name$,file_n~ 1h x~w,y2w) ! i(5) ! Read *.ct and plot the edges and cutter motion in 3D
! name$: object name ! file_num: cut coordinate file number, *.ct ! dh: slice thi~ nPss ! 0,x2w,0,y2w: window size file_bot$="object~" & name$ & "~" & Str$(file_num) & ".pt"
file_top$="object\" & name$ & "\" & Str$(file_num+1) & " pt"
file_cut$="object~" & name$ ~ "~" & Str$(file_num) & ".ct"
file_ctx$="object\" & name$ & "\" & Str$(file_num) & ".ctx"
CALL open_file(~l,file_bot$,error) IF error=1 THEN exit sub CALL open file~#2,fi1e_top$,error) IF error=1 THEN exit sub CALL open_file(#3,file_cut$,error) IF error=l THEN exit sub CALL open_file(~M,file_ctx$,error) IF error=l THEN exit sub ASK # I :FILESIZE num_rec_b ASK #2:FILESIZE num_rec_t ASK #3:FILESIZE num rec_cut ASK #4:FILESIZE num_rec_ctx LET num_po~nt_b=num_rec_b/2 LET num_point_t=num_rec_t/2 LET num_cut=num_rec_cut/4 LETnum match=(num rec_ctx-5)/13 CLEAR
CALL PersWindow(0,x2w,0,y2w,0,dh) ! define window size in 3d SET BACK "red"
SET COLOR "white"
!CALL AskScale3(hor,ver) IF hor<1.2 THEN CALL SetScale3(1.2,1.2) CALL Axes3 CALL PlotText3(x2w,0,0,"X") CALL PlotText3(0,y2w,0,"Y") CALL PlotText3(0,0,dh,"Z") CALL PlotText3(0,0,0,"0") SET COLOR "yellow"
PRINT num point_b;"points in ";str$(file_num);".pt"
PRINT num_point_t;"points in ";str$(fi1e_num+ 1 );".pt"
P~NT num_cut;"cut steps in ";str$(file_num);".ct"
RESET #4:record num_rec_ctx-4 READ #4 xmin~xm~x)ymin~ym~x/m~x-angle a~-xmin ysize=ymax-ymin PRINT
PRINT ""
PRINT " Slice size x/y: ";xsize;"/";ysize PR~NT " Max angle:";max angle W O 97/37317 PC~nUSg7/05~19 .-!

! draw top and bot point file SET COLOR "blue"
FOR i-l TO num_point_b ! plot bot edge READ #I:xl,yl CALL PlotOff3(xl,yl,0) NEXT i !CALL PlotOff3(xl,yl,0) SET COLOR "white"
FOR i=1 TO num_point_t ! plot top edge READ #2:x2,y2 CALL PlotOff3(x2,y2,dh) NEXT i !CALL PlotOff3(x2,y2,dh) !

! plot cutter path SET COLOR "yellow"
FOR i=l TO num_match RESET #4:record (i- I )* 13+1 READ #4:rec_start,rec_end n_cut=(rec_end-rec_start+ 1 )/4 RESET #3 :record rec_start FOR j=l TO n_cut ! plot cutter motion READ #3:xl,yl,x2,y2 CALL PlotOff3(x 1 ,y 1,0) ! draw top bot cutter points CALL PlotOff3(x2,y2,&) NEXT j NEXT i CLOSE # I
CLOSE #2 CLOSE #3 CLOSE #4 END SUB
!*****ttttttttttttt~tttt********
!Sub,~ul~e. draw_auto_cut_2d !ttt.t..~t.~....~t~ttttt*********
SUB draw_auto_cut_2d(n~m,-~,ct~ ?nl1 rlh x~w,y2w) ! i(6) ! Read from start.ct to end.ct, and plot cutter motion in 3D
! name$: object name ! start,end: start and end num of cut file, *.ct ! &: slice thickness ! 0,x2w,0,y2w: window size FOR i=start TO end CLEAR
CALL draw_cut_3d(name$,i,dh,x2w,y2w) GET KEY getkey NEXT i END SUB
!**********tttttttt~tt****
! Snl,loululc. draw_st 3d !*~******~ttttt~*-********
SUB draw_st_3d(name$ ,file_num,-lh cpace_b,space_t,x2w,y2w,x I s,x2s,y 1 s,y2s,xh,yh) ! all input ! Read *.st and plot cutter motion in 3D

CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/0~419 ! name$: object name ! file num: file num of *.st ! dh: slice thirknlocc ! space_b,space t: space bw top and bottom pivot point and form ! 0,x2w,0,y2w: window size ! xls,x2s,yls,y2s: step/cm conversion for x,y direction of top and bot ! xh,yh: home position from the orgin of a coord system file bot$="object\" & name$ & "\" & Str$(fi1e_num) & ".pt"
file top$="object\" ~ name$ & "\" & Str$(file_num+1) & ".pt"
file ct$="object\" & name$ & "\" & Str$(file num) & ".ct"
file ctx$="object\" & name$ & "\" & Str$(file_num) & ".ctx"
file_st$="object\" & name$ & "\" ~ Str$(file_num) & ".st"
CALLopen file(#l,file_bot$,error) IF error=l THEN exit sub CALL open file(#2,file_top$,error) IF error=l THEN exit sub CALL open file(#3,file_ct$,error) IF error=l THEN exit sub CALL open_file(#4,file ctx$,error) IF error=l THEN exit sub OPEN #5:name file s~ ccecs input, org text ASK # I :FILESIZE num_rec_b ASK #2:FT~ F~ F num rec t ASK #3:FILESIZE num rec_ct ASK #4:FILESIZE num rec_ctx LET num point_b=num rec b/2 LETnum_point t=num rec t/2 LET nurn_ct=(num_rec ct-5)/4 RESET #4:record num_rec_ctx-4 READ #4 xmin,xm~x,ymin,ym~x m~x_angle CALL PersWindow(0,x2w,0,y2w,0,dh) ! de~me window size in 3d SET BACK "red"
SET COLOR "white"
!CALL AskScale3(hor,ver) IF hor<l .2 THEN CALL SetScale3( 1.2,1.2) CALL Axes3 CALL PlotText3(x2w,0,0,"X") CALL PlotText3(0,y2w,0,"Y") CALL PlotText3(0,0,dh,"Z") CALL PlotText3(0,0,0,"0") SET COLOR "yellow"
PRINT num point_b;"points in ";str$(file_num);".pt"
PRINT num_point_t;"points in ";str$(file num+l);".pt"
PRINT num_ct;"cuts in ";str$(file_num);".ct"
PRINT
PRINT ""
PRINT " Slice size x/y: ";xmin xm~x;"/";ymin;ymax PRINT" dx/dy:";xmax-xrnin;"/";ymax-ymin PRINT " Max angle:";max_angle ! draw cut file xs=xh-xmin ys=yh-ymin CA 022~0822 l998-lO-Ol W O 97/37317 PCT~US97/05419 SET COLOR "blue"
RESET #3:begin FOR i=l TO num_ct ! plot bot edge READ #3:xl,yl,x2,y2 xl=xl+xs x2=x2+xs yl=yl+ys y2=y2+ys CALL PlotOff3(xl,yl,0) CALL PlotOff3(x2,y2,&) NEXT i !

! plot cutter path SET COLOR "yellow"
h=space_b+space_t+dh ratio_b=(space_b)/h ratio_t=(space_b+&)/h xlo,x20,ylo,y20=O
RESET #5:Begin DO WHILE MORE #5 ! plot cutter motion INPUT #5:xl$
INPUT #5:yl$
INPUT #5:x2$
INPUT #5:y2$
xl=Val(xl$) x2=Val(x2$) y I =Val(y l $) y2=Val(y2$) xl=xl/xls ! abs coord of slide in cm x2=x21x2s yl=yl/yls y2=yl+y2/y2s xb=xl+(x2-xl)*ratio_b ! abs coord on the foam in cm xt=xl+(x2-xl )*ratio_t yb=y1+(y2-y1)*ratio b yt=yl+(y2-yl)*ratio_t set color "yellow"
CALL lineOff3(xlo,ylo,0,xb,yb,0) ! draw top bot cutter points CALL lineOff3(x20,y20,&,xt,yt,dh) set color "blue"
CALL lineOff3(xlo,ylo,0,xb,yb,0) ! draw top bot cutter points CALL lineOff3(x20,y20,dh,xt,yt,dh) xlo=xb x20=xt ylo=yb y20=yt LOOP
CLOSE #l CLOSE #2 CLOSE #3 CLOSE #4 CLOSE #5 CA 022~0822 1998-10-01 - W O 97137317 PCTrUS97/05419 END SUB
!******~t*~t~ ********
! S~ c,ul..-~,. draw_auto_st_3d !*******************************
SUB draw_auto_st_3d(n~m~$ ~t~rt,end,dh,space_b,space t,x2w,y2w,xIs,x2s,y1s,y2s,xh,yh) ! all input ! Read from start.st to end.st, and plot cutter motion in 3D
! name$: object name ! start,end: start and end file num, *.st ! dh: slice thickn~c~
! space b,space_t: space bw top and bottom pivot point and form ! 0,x2w,0,y2w: window size ! x I s,x2s,y I s,y2s: step/cm conversion for x,y direction of top and bot ! xh,yh: home position from the orgin of a coord system FOR i=start TO end CLEAR
CALL draw_st 3d(name$,i,dh,space_b,space_t,x2w,y2w,xls,x2s,yls,y2s,xh,yh) GET KEY getkey NEXT i END SUB
!**************************
! Subroutine: Registration !***********~**************
SUB registration(object$,start,~n~1 ~m~x ymax) ! i(5) ! Read *.ln, and plot it in 2D for registration hole.
! start,end: start and end *.ln file num to decide reg holes ! 0,xmax,0,ymax: window size OPEN #5:SCREEN 0,1,0,0.8 SET WINDOW 0,xmax,0,ymax ! define window coordinate SET COLOR "yellow/red"
OPEN #6:SCREEN 0,.5,0.8,1 SET COLOR "yellow/red"
OPEN #7:SCREEN 0.5,1,0.8,1 SET COLOR "yellow/red"
WINDOW #5 FOR i=start TO end file_ln$="object\" & object$ & "\" & str$(i) & ".In"
CALL open_file(# I ,file_ln$ ,error) IF error=1 THEN exit sub ASK #l :FILESIZE record num line_llu..l-l~ cul~l_num/4 ! compute number of points FOR j=l TO line_num READ #l:xl,yl,x2,y2 PLOT xl,yl;x2,y2 NEXT j CLOSE #l NEXT i DO
WINDOW #6 CLEAR
PRINT " Select choice"
PRINT " (0) exit."
PRINT " (I) mouse."

PRINT " (2) draw hole."
PRINT " (3) redraw."
INPUT PROMPT "choice ":n IF n=0 THEN
exit sub ELSE IF n=l THEN
WINDOW #6 CLEAR
~ PRINT " x I y"," dx / dy"
PRINT
PRlNT "File: " ;start; "to " ;end PRINT "Press SHIFT-CLICK to quit."
xold,yold=0 DO
WINDOW #S
GET MOUSE x,y,ch IF ch=2 THEN ! click x=round(x, l ) y=round(y, 1 ) dx=abs(x-xold) dy=abs(y-yold) WINDOW #7 PRINT x;y,dx;dy xold=x yold=y END IF
LOOP UNTIL ch=4 ELSE IF n=2 THEN
WINDOW #6 CLEAR
INPUTPROMPT"numberofholes? ":num hole FOR i =l TO num hole WINDOW #6 INPUT PROMPT "radius,xc,yc? ":radi,xc,yc WINDOW #5 SET COLOR "blue"
BOX circle xc-radi,xc+radi,yc-radi,yc+radi SET COLOR "yellow"
NEXT i ELSE IF n=3 THEN
WINDOW #5 CLEAR
FOR i=start TO end file In$="object\" & object$ & "~" & str$(i) & ".ln"
CALL open_file(#l,file ln$,error) IF error=1 THEN exit sub ASK # I :FILESIZE record_num line ~ .cold_num/4 ! compute number of points FORj=l TO line_num READ #l:xl,yl,x2,y2 PLOT x l ,y l ;x2,y2 NEXT j CLOSE #l NEXT i END IF
LOOP
END SUB
!***4~
! End of File ! ***

W O 97/37317 PCT~US97105419 !******************************************************************
! Written by Cheol Lee ! File: 72-gln.tru ! Date: 10/95 ! Object: draw *.ln, *.lp, *.pt file ! Input: *.ln, *.lp, *.pt ! Output: 2D or 3D drawing of files !******************************************************************
dim a(0,0),b(0,0) library "69-1-vtx.tru"
library "69-ut.tru"
library "3dlib.trc"
xmin,ymix=0 xmax,ymax= 1 00 !call draw_line(l,0,"yellow",~rmin xm~x ymin,ymax) ! call regictr~tion(1,50,100,100) ! call draw auto_loop_2d(3,3,0,10,10) end EXTERNAL
!*********
! Surnrnary (72-gln) ! *********
! SUB draw_line(name$,file_1n,sec,x2w,y2w) ! SUB draw_loop(n~me$,fil~_1p,sec,x2w,y2w) ! SUB draw_line_array(a(,),dim al ,sec,x2w,y2w) ! SUB draw_point(n~m~ S fil~._pt,sec,x2w,y2w) ! SUB draw_bounds(file_lpx,x2w,y2w) ! SUB draw_auto_line_2d(start,~nrl c~c x~w,y2w) ! SUB draw_auto_loop_2d(start,~n~ ge~ ~w,y2w) ! SUB draw auto_point_2d(start t-n-l cec x~w,y2w) ! SUB draw_auto_line_3d(h_bot,h_top,dh,x2w,y2w,z2w) *~t***************
! Sul,.uu~ e: draw_line !***********************
SUB draw_line(n im~$~fi~ ln~sec~x2w~y2w) ! i(5) ! Read *.ln and plot it in 2D
! name$: object name ! file In: line coordinate file number, *.ln ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size file_ln$="object\" & name$ & "\" & str$(file_1n) & ".In"
CALL open_file(#l,file_ln$,error) IF error=l THEN exit sub SET WINDOW 0,x2w,0,y2w ! define window coordinate SET COLOR "yellow"
SET BACK "red"
ASK #l :FILESIZE record_num LET line_..u~ ,uld_num/4 ! cûmpute number of lines FOR i=l TO line_nurn READ #I:xl,yl,x2,y2 PLOT xl,yl;x2,y2 PAUSE sec NEXT i CA 022~0822 1998-10-01 CLOSE #1 PRINT line num;"lines in ";str$(fi1e_1n);".1n"
END SUB
!***********************
! Subroutine: draw loop !*********
SUB draw loop(name$,fi1e_1p,sec,x2w,y2w) ! i(S) ! Read *.lp and plot it in 2D
! name$: object name ! file_lp: loop coordinate file number, *.lp ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size file_lp$="object~" & name$ & "\" & str$(file_1p) & ".Ip"
file_lpx$="object\" & name$ & "\" & str$(file_1p) & ".lpx"
CALL open file(#l,file Ip$,error) IF error I THEN exit sub CALL open_file~#2,file_1px$,error) IF error-l THEN exit sub ASK #I:filesize num_lp_rec ASK #2:filesize num_idx_rec num_l.n~ .~ul~l_lp_rec/4 num_loo~,---u..._idx_rec/l 0 SET WINDOW 0,x2w,0,y2w ! define window coordinate SET COLOR "yellow"
SET BACK "red"
FOR i=l TO num_line READ #I:xl,yl,x2,y2 PLOT xl,yl;x2,y2 PAUSE sec NEXT i CLOSE #l PRINT num_line;" lines in ";str$(file_1p);".1p"
FOR i= I TO num_loop READ #2:start,end,xd,yd,xu,yu,xl,yl,xr,yr PRINT "#";i;": loop size = xl/x2,yl/y2 :";xl;"/";xr;", ";yd;"/";yu NEXT i CLOSE #l CLOSE #2 END SUB
!*******~ **~**********
! Subluuli.. c: draw_line_array !****************~ *****
SUB draw line_array(a(,),dirn_al,sec,x2w,y2w) ! i(5) ! Read line cooldu.ale array and plot it in 2D.
! a(,),dim_al: a(dim_al,4). num of lines ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window s~ze SET WlNDOW 0,x2w,0,y2w ! define window coordinate SET COLOR "yellow"
SET BACK "red"

IF dim_a 1=0 THEN
PRINT "No line."
END IF
FOR i= I TO dim_a I
PLOT a(i, I ),a(i,2);a(i,3),a(i,4) PAUSE sec NEXT i END SUB
!****~t~ ********
! Sub1uu~ e. draw_point !************************
SUB draw_point(n~m-o$,fi1t~_pt,sec,x2w,y2w) ! i(S) ! Read *.pt and plot it in 2D
! name$: object name ! file_pt: point coordinate file, *.pt ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size file_pt$="object\" & name$ & "\" & str$(file~pt) & ".pt"
CALLopen_file(#l,file pt$,error) IF error= I THEN exit sub SET WINDOW 0,x2w,0,y2w ! define window coordinate SET COLOR "yellow"
SET BACK "red"
ASK #l :FILESIZE record_num LET point_...~ cold_num/2 ! compute number of points FOR i=l TO point_num PAUSE sec READ #l :x,y PLOT x,y NEXT i PRINT point_num;"points in ";str$(file pt);".pt"
CLOSE # I
END SUB
!************************
! Sub1uulille. draw_bounds !******~*****************
SUB draw_bounds(name$,file_1px,x2w,y2w) ! i(4) ! Read loop index file, and draw all loûp bounds with color ! name$ : object name ! file_lpx$: loop index file, *.lpx ! 0,x2w,0,y2w: window size file_lpx$="object\" & name$ & "\" & str$(file_1px) & ".Ip~"
CALL open_file(#l,file_lpx$,error) IF error-1 THEN exit sub ASK #I:f~T .F.!~17.F n LET num_loop~Jl0 SET COLOR "blue"
scale=0.05 dx-x2w*scale dy=y2w*scale FOR i=l TO num_loop READ # I :start,end,xd,yd,xu,yu,xl,yl,xr,yr PLOT xl+dx,yl;xl,yl CA 022~0822 1998-10-01 PLOT xr-dx,yr;xr,yr PLOT xd,yd+dy;xd,yd PLOT xu,yu-dy;xu,yu NEXT i END SUB
!*#*****************************
! Subroutine: draw_auto_line_2d !*******************************
SUB draw_auto_line 2d(nqm~ $~ctqrt~çn(l ceC x~w,y2w) ! i(6) ! Read from start.ln to end.ln, and plot it in 2D
! name$ : object name ! start,end: start and end num of line file, *.ln ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size FOR i=start TO end CLEAR
CALL draw_line(nqmç$,i cec x~w,y2w) GET KEY getkey NEXT i END SUB
!********#************
! Subroutine: draw_auto_loop_2d !******************************~
SUB draw_auto_loop_2d(name$,start,end,sec,x2w,y2w) ! i(6) ! Read from start.lp to end.lp, and plot it in 2D
! name$ : object name ! start,end: start and end num of loop file, *.lp ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size FOR i=start TO end CLEAR
CALL draw_loop(name$,i,sec,x2w,y2w) CALL draw_bounds(name$,i,x2w,y2w) GET KEY getkey NEXT i END SUB
!*****~ tt~*****************
! Subroutine: draw_auto_point_2d !*******~***********************
SUB draw_auto_point_2d(name$,start,end,sec,x2w,y2w) ! i(6) ! Read from start.pt to end.pt, and plot it in 2D
! name$ : object name ! start,end: start and end num of point file, *.pt ! sec : pause time between drawing lines ! 0,x2w,0,y2w: window size FOR i=start TO end CLEAR
CALL draw_point(rqrn~$ i cçc~x2w~y2w) GET KEY getkey NEXT i END SUB

CA 022~0822 1998-10-01 - W O 97/37317 PCTrUS97/05419 !**********#*************
! Sul,-~ulille: draw_auto_line_3d !*******************************
SUB draw_auto_line_3d(name$,h_bot,h_top,dh,x2w,y2w,z2w) ! Read all line files (*.ln) and draw them in 3D
! h_bot,h top: height of bottom and top of object ! dh : slice thir~nPss ! 0,x2w,0,y2w,0,z2w: 3D window size CALL ParaWindow (0,x2w,0,y2w,0,z2w) ! defLne window coordmate SET BACK "red"
SET COLOR "white"
!CALL SetScale3(1.1,1.1) CALL Axes3 CALL PlotText3(x2w,0,0,"X") CALL PlotText3(0,y2w,0,"Y") CALL PlotText3(0,0,z2w,"Z") CALL PlotText3(0,0,0,"0") SET COLOR "yellow"
LET num_slice=lnt((h_top-h bot)/dh) LET num_file=num_slice+ I ! number of line files FOR i=l TO nurn_file ! read a line file and draw line LET h=h_bot+(i-l)*dh ! slice height LET file_line$="object\" & name$ & "\" & Str$(i) & ".In" ! line file name to read OPEN #l :name file_line$,access input ! line file ASK #l :FILESIZE record_num LET line_.lu~ ol.i_num/4 ! compute number of lines FOR j=l TO line num ! plot lines one at a time READ #l:xl,yl,x2,y2 CALL LineOff3(xl,yl,h,x2,y2,h) NEXT j PAUSE pause_sec CLOSE #l NEXT i END SUB
!*************
! End of File !*************

CA 022~0822 1998-10-01 - W O 97/37317 PCT~US97/05419 --!**#**************4************************************#*****
~ WriTten by Cheol Lee ! File: 72-gvt.tru ~ Date: 10/95 ! Object: draw *.vtx file ! Input: vertex record file. *.vtx ! Output: wireframe 3D drawing of an object !************************~**************~tt-.~t************
library "67-1-vtx.tru"
library "67-ut.tru"
library "3dlib.trc"
end EXTERNAL
!*********
! Summary (72-gvt) ! ***~*****
! SUB draw_vtx_3d(name$,x2w,y2w,z2w) !*************************
! Subroutine: draw_vtx_3d !*************************
SUB draw_vtx_3d(name$,x2w,y2w,z2w) ! i~4) ! Read vertex file and draw wl.er a.l-e 3~ plot ! name$: object name *.vtx ! 0,x2w,0,y2w,0,z2w: 3d window size file_vtx$="object\" & name$ & ".vtx"
CALL open_file(#l,file_vtx$,error) IF error= I THEN exit sub ASK # I :FILESIZE num_rec LET num tri=nurn_rec/9 CALL ParaWindow(0,x2w,0,y2w,0,z2w) SET BACK "Ted"
SET COLOR "white"
CALL Axes3 CALL PlotText3(x2w,0,0,"X") CALL PlotText3(0,y2w,0,"Y") CALL PlotText3(0,0,z2w,"Z") CALL PlotText3(0,0,0,"0") SET COLOR "yellow"
FOR i=l to num_tri READ #l:xl,yl,zl,x2,y2,z2,x3,y3,z3 CALL ploton3(xl,yl,zl) CALL ploton3(x2,y2,z2) CALL ploton3(x3,y3,z3) CALL plotoff3(xl,yl,zl) NEXT i PRINT num_tri;''triangles in ";name$;".vtx"
PRINT " obJect size x:";x2w;" y:";y2w;" z:";z2w END SUB
!*************
! End of File !*****~

CA 022~0822 1998-lO-01 !*********************************************************************
! Written by Cheol H.Lee ! File: 72-main.tru ! Date: 6/96 ! Object: main program to control SM2 ! Input: *.stl, job selection ! Output: driving machine !*********************************************************************
! M EM O
! - *.stl, *.vtx files are in "object\" directory ! - *.ln,*.lp,*.lpx,*.pt,*.ptx,*.ct,~.ctx,*.st,ctreport.txt files are in ! "object\[object_name]\" directory ! - setup.rp is in "object\" directory ! - rp-mt4.c is in "bc31\bin\" directory ! - rp-mt4.c will read *.st and ctreport.txt in "\object\temp\" directory !**********~ *************************************************
LIBRARY "72-1-vtx.tru"
LIBRARY "72-2-lnl.tru"
LIBRARY "72-2-ln2.tru"
LIBRARY "72-3-lp2.tru"
LIBRARY "72-3-lpl.tru"
LIBRARY "72-4-pt.tru"
LIBRARY "72-5-ct2.tru"
LIBRARY "72-5-ct l .tru"
LIBRARY "72-6-st.tru"
LIBRARY "72-ut.tru"
LIBRARY "72-gvt.tru"
LIBRARY "72-gln.tlu"
LIBRARY "72-gct.tru"
LIBRARY "72-menu.tru"
LIBRARY "3dlib.trc"
LIBRARY "utillib2.tru"
LIBRARY "utillib l .tru"
LIBRARY "shell.tru"
!LIBRARY "72-1-vtx.trc"
!LIBRARY "72-2-lnl .trc"
!LIBRARY "72-2-ln2.trc"
!LIBRARY "72-3-lp2.trc"
!LIBRARY "72-3-lpl.trc"
!LIBRARY "72-4-pt.trc"
!LIBRARY "72-5-ct2.trc"
!LIBRARY "72-5-ctl.trc"
!LIBRARY "72-6-st.trc"
! LIBRARY "72-ut.trc "
! LIBRARY "72-gvt.trc "
!LIBRARY "72-gln.trc"
!LIBRARY "72-gct.trc"
! LIBRARY " 72 -menu.tru "
! LIBRARY "3dlib .trc "
!LIBRARY "utillib2.trc"
!LIBRARY "utillibl.trc"
!LIBRARY "shell.tru"
DIM a(0,0),b(0,0),index(10,10) xls,x2s,y2s=800 yls=120.63 !num_var=26 CA 02250822 1998-lO-01 - W O 97~7317 PCTrUS97/05419 ! ~ ~ t ~ *~*
! Main Program !~*~****~*****
SET MODE "vga"
CALL read_setup (name$,num_tri,.1h,~ngl~ e-race_t,space b,d_loop,d_point,&
& xmax,ym~Y 7m~x xh yh,~ .cim ~l eljr) !

! menu job loop DO
MAT REDIM a(0,0),b(0,0) ! save memory !------! menu rwin=.8 IF xmax*rwin>ymax THEN ! window size x~ a~
*r~vin :GWill--;~,llldX.
ELSE
xwin=ymax/rwin ywin=ymax zwin=zmax END IF
CALL status (r ~m~$7rnm_tri,~h ~ngle,~pa~e_t,space_b,d_loop,d~oint,&
& xmax,ym~x,7m ix~h~yh~decim:ll el-jp) CALL main_menu (job) CLEAR
SET COLOR "white"
!

! main job description SELECT CASE job CASE 0 ! quit STOP
CASE I
DO
!exit do ! remove dos shell for memory CLEAR
PRINT "Press (0) to return to main menu."
INPUT PROMPT "DOS cnmm nr1 ":com$
IF com$="0" THEN
EXIT DO
ELSE
CALL shell~com$) END IF
GET KEY getkey LOOP
!----! job setup CASE 2 ! change job setup DO
!

! setup menu CALL status (n~m~ n--nn_tri,dh,angle,space_t,space_b,d_loop,d point,&
& xmax,ym~x 7m~x xh yh,decim 1l cki CALL setup_menu(job_setup) CLEAR
SET COLOR "white"

CA 022~0822 l998-lO-Ol SELECT CASE job_setup CASE 0 ! return to main menu EXIT DO
CASE l ! foam thickness PRINT "current foam thickness: ";dh INPUT PROMPT "Foam thickn~ce (cm)? ":dh CASE 2 ! max cutter angle PR~NT "current cutter angle: ";angle INPUT PROMPT "Maximum cutter angle (degree)? ":angle CASE 3 ! bot space PRINT "current bottom space: ";space_b INPUT PROMPT "Bottom space from the foam (cm)? ":space_b CASE 4 ! top space PRINT "current top space: ";space_t INPUT PROMPT "Top space from the foam (cm)? ":space_t CASE l l ! loop distance PRINT "current loop dlstance: ";d_loop INPUT PROMPT "Minimum distance between loops (cm)? ":d loop CASE 12 ! point distance PRINT "current point distance: ";d_point INPUT PROMPT "Maximum distance between points (cm)? ":d_point CASE 13 ! skip PRINT "current skip points: ";skip ~NPUT PROMPT "Skip points? ":skip CASE 14 ! decimal PRINT "current rount decimal: ";decimal INPUT PROMPT "Round decirnal? ":decimal CASE 21 ! home position PRINT "current home position: ";xh;yh INPUT PROMPT "Home position x,y (cm)? ":xh,yh CASE 31 ! save setup CALL save setup(name$,num_tri,~1h ~ngll cp~ce_t,space b,d loop,d_point,&
& xmax,ym~x,7.m~x,xh yh,decim~l,Q~ip) EXIT DO
CASE ELSE
PRINT "Job is not available. Select again "
GET KEY key EXIT SELECT
END SELECT
LOOP
! object CASE 3 ! combine STL files CALL shell("dir/wlo:n object\*.stl") CA 022~0822 1998-10-01 WO 97~7317 PCTrUS97/05419 .-PRINT "Press (0,0,0) to cancel."
INPUT PROMPT "stl_inl, stl_in2,0stl_in3? ":inl$,in2$,out$
IF inl$="O" and in2$="0" and out$="O" THEN EXIT select PRINT "Wait..."
CALL combine_stl(inl$,in2$,out$) CASE 4 1 append STL files CALL shell("dir/w/o:n object\*.stl") PRINT "Press (0,0) to cancel."
INPUT PROMPT "stl_inout, stl_in.":inout$,in$
IF inout$="O" and in$="O" THE~N EXIT select PRINT "Wait..."
CALL append_stl(ino--t~ inC) CASE 5 ! stl to object CALL shell("dir/w/o:n object\*.stl") PRINT "Press (O) to cancel."
INPUT PROMPT "Object name? ":name$
IF name$="O" THEN exit select com$="md object\" & name$
CALL shell(com$) CLEAR
CALL stl_to_vtx(nqm.o~,m-m_tri,xmax,ymqx 7mqx) CLEAR
CALL draw_vtx_3d(nqmf~,xmqx,ymqx 7.mqx) GET KEY key CASE 6 ! select object CALL shell("dir/w/o:n object\*.vtx") temp$=name$
PRINT "Press (O) to cancel. "
INPUT PROMPT "Object name? ":name$
IF name$="O" THEN
name$=temp$
exit select END IF
CALL object_size(rtqtnP$,xmin xmqx~ymin~ymqx 7.min 7mox nl~m tri) CASE 7 ! rotate object PRINT "Press (0,0,0) to cancel."
PRINT "Current object is ";name$
PRINT
INPUT PROMPT "Rotated object name~ axes, angle? ":name_out$,rot_axes$,rot_angle IF rot_angle=O THEN exit select CALL rotate_vtx(narne$,rot_axes$,rot angle,xmax,ymqx 7mqx,nqm~ _out$) name$=narne_out$
CLEAR
CALL draw_vtx_3d(name$,xmax,ym-qx 7mqx) GET KEY key CASE 8 ! resize object PRINT "Press (0,0,0,0) to cancel."
PRINT "To convert INCH into CM, scale=2.54."
PRINT "Current object is ";name$
PRINT

CA 022~0822 1998-10-01 INPUT PROMPT "Scaled object name, ratio(x,y,z)? ":name_out$,xr,yr,zr IF x~l and yr=l and zr=l THEN exit select IF xr=0 and yr=0 and zr=0 THEN exit select CALL scale_vtx_file(name$,xr,yr,zr,xmax,yrn~x 7.m ~7~ nqrnf out$) name$=name_out$
CASE 9 ! registration INPUT PROMPT "Start, end file number?: ":start,end CLEAR
CALL registration(name$,start,end,xwin,ywin) !---! a slice CASE 11 ! object to one line PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thirkn~cc ";dh;", number of line file:";int(zmax/dh)+l INPUT PROMPT "Line file number, cut height? ":file_ln,slice_h IF file_ln=0 and slice_h=0 THEN exit select CALL vtx_to_line_h(name$,slice_h,decim~1 file_1n) CLEAR
CALL draw_line(nqm~$,filP In,0,xmax,ymax) GET KEY getkey CASE 12 ! object to lines PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thif~n. c.c ";dh;", number of line file:";int(zmax/dh)+l INPUT PROMPT "start, end line files? ":start,end IF start=0 THEN Exit select CALL vtx_to_line~n~rnl~ st~rt,end,dh,decimal) GET KEY getkey CASE 13 ! lines to loops PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thir.knPcs ";dh;", number of loop file:";int(zmax/dh)+ I
INPUT PROMPT "start, end loop files? ":start,end IF end=0 THEN exit select CALL line-to-loop(n~rn~$~ct~rt~end~d-loop) GET KEY getkey CASE 14 ! loop to point PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam ~hir~nl~cc ";dh;", number of point file:";int(zmax/dh)+ I
INPUT PROMPT "start, end point files? ":start,end IF end=0 THEN exit select CALL loop_to point(nqm~,ct~rt,end,d point,decima~, 1) GET KEY key CASE 15 ! point to cut PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax,", foam thicknl~cc ";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "start, end cut files? ":start,end IF start=0 and end=0 THEN exit select - reverse=0 INPUT PROMPT "reverse(0/1)? ":reverse CALL auto cut(name$,start,end,reverse,dh,angle,decim 1l QI ip) GET KEY getkey CA 022~0822 1998-10-01 - WO 97/37317 PCT/US97/05419 . -CASE 16 ! cuts to steps PRlNT "Press (0,0) to cancel. "
PRNT "object height:";zmax;", foam thirknecc ";dh;", number of cut file:";int(zmax/dh) ~PUT PROMPT "start, end step files? ":start,end IF starP0 and end=0 THEN exit select INPUT PROMPT "number of holes(0-n)? ":num hole CALL auto_step(n~m~$ ct~rt,end,num_hole,dh,space_b,space t,&
& d point,skip,xh,yh,xls,x2s,yls,y2s) GET KEY getkey CASE 21 ! remove loop PRINT "Press (0) to cancel."
PR~NT "object height: " ;zmax;", foam lS. i~l~ . .. cC ";dh;", number of loop file: " ;int(zmax/dh)+ l INPUT PROMPT "loop file number? ":file_lp IF file_lp=0 THEN exit select CLEAR
CALL draw_auto_loop_2d(n~mr$ f~1e_1p,file_1p,0,xwin,ywin) SET COLOR "yellow"
PRINT
PRINT " Press (0) to cancel."
INPUT PROMPT " loop number to be removed? ":Ip_num IF Ip_num=0 THEN exit select CALL remove_loop(name$,file_1p,1p_num) CLEAR
CALL draw_auto_loop_2d(n~-ne$,file lp,file_lp,0,xwin,ywin) CASE 22 ! reverse loop PRINT "Press (0) to cancel."
PRINT "object height:";zmax;", foam thir~necc ";dh;", number of loop file:";int(zmax/dh)+1 INPUT PROMPT "loop file number? ":file_lp IF file_lp=0 THEN exit select CLEAR
CALL draw_auto_loop_2d(name$,file_1p,f11e_1p,0,xwin,ywin) SET COLOR "yellow"
PRINT "Press (0) to cancel."
~NPUT PROMPT "loop number to be reversed? ":lp_num IF Ip_num=0 THEN exit select CALL reverse_loop(name$,file_1p,1p_num) CLEAR
CALL draw_auto_loop_2d(n~me$ file_lp,file_lp,0,xwin,ywin) CASE 23 ! point to cut (SM1) PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thir~necc ";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "start, end cut files? ":start,end IF start=0 and end=0 THEN exit select CALL auto_cut sml(name$,start,end,decimal) GET KEY getkey !------! Read CASE 41 ! read loop index file PRINT "Press (0,0) to cancel."
PRINT "object hei~ht:";zmax;", foam thirlrnesc ";dh;", number of loop file:";int(zmax/dh)+1 CA 022~0822 1998-lO-01 W O 97/37317 PCTrUS97/05419 INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL auto_read_lp_index(name$,start,end) CASE 42 ! read point index file PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thirkne5s-";dh;", number of point file: ";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start--0 and end=0 THEN exit select CALL auto_read_pt_index(n ~m~ ct Irt~end) CASE 43 ! read ct index file PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of point file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CALL auto_read_ct_index(name$,start,end) CASE 44 ! read coord file PRINT "Press (0) to cancel."
PRINT "object height:";zmax;", foam 11"~ ss ";dh;", number of line file:";int(zmax/dh)+l INPUTPROMPT"Coold filename? ":file name$
IF file_name$="0" THEN exit select file_name$="object\" & name$ & "\" & file_name$
CALL read record file(file_name$,4) GET KEY getkey CASE 45 ! cut report PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thickness:";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "File number start, end? ":start,end slice=int(zmax/dh) CALL cut_report(name$,num_tri,~1h ~n~le cp?.çe_t,space_b,d loop,d_point,&
& xmax,ym~x,7m~x,xh,yh,decim~ ip,clice,ct~rt,end) CASE 46 ! read report CALl,read cut_report(name$) PRINT
INPUT PROMPT "print? ( 1/0)? ":temp PRINT
IF temp=l THEN
com$="print object\" & name$ & "\ctreport.txt"
CALL shell(com$) END IF
!

.c view CASE 51 ! view object - wire ~ CLEAR
CALL draw_vtx_3d(name$,xmax,ymax,zmax) GET KEY getkey CASE 52 ! view lines 3D
PRINT "Press (0,0) to cancel."
PRINT "object height:";zmax;", foam thir~nl~cc:";dh;", number of line file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end CA 022~0822 1998-10-01 - W O 97/37317 PCT~US97/05419 IF start=0 and end=0 THEN exit select h_boP(start- I )*dh h_top=(end- I )*dh CLEAR
CALL draw_auto_line_3d(name$,h_bot,h_top,-lh ,~m i~,ym~ 7m~x) GET KEY getkey CASE 53 ! view lines 2D
PRINT "Press (0,0) to eaneel."
PRINT "objeet height:";zmax;", foarm thi~n~-.c.c ";dh;", number of line file:";mt(zmax/dh)+l ~NPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit seleet CLEAR
CALL draw_auto line_2d(name$,start,end,0,xwin,ywin) CASE 54 ! view loops PRINT "Press (0,0) to caneel."
PRINT "object height:";zmax;", foam thi~nl c.c ";dh;", number of loop file:";int(zmax/dh)+l INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CLEAR
CALL draw_auto_loop_2d(r ~ $,ct~rt,end,O,xwin,ywin) CASE 55 ! view points PRINT "Press (0,0) to eaneel."
PRINT "objeet height:";zmax;", foam thi~ n~cc ";dh;", number of point file: ";int(zmax/&)+ I
INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit select CLEAR
CALL draw_auto_point_2d(n~m~$ ct~rt,end,0,xwin,ywin) CASE 56 ! view cuts PRINT "Press (0,0) to caneel."
PRINT "object height:";zmax;", foam thirkn.occ:";dh;", number of cut file:";int(zmax/dh) INPUT PROMPT "start, end number? ":start,end IF starP0 and end=0 THEN exit select CALL draw_auto_eut_2d(n~mP$,ct~rt,end,dh,xwin,ywin) CASE 57 ! view steps PR~NT "Press (0,0) to eaneel."
PRINT "objeet height:";zmax;", foam thi~n~cc ";dh;", number of step file:";int(zmax/dh) INPUT PROMPT "start, end number? ":start,end IF start=0 and end=0 THEN exit seleet FOR i=start TO end CLEAR
CALL draw_st_3d(name$ i -1h cp~ce_b,spaee_t,xwin,ywin,xls,x2s,yls,y25,xh,yh) GET KEY getkey NEXT i CASE 91 ! prepare eom$="eopy objeet\" & name$ & "\*.st object\temp"
CALL shell(eom$) com$="copy objeet\" & name$ & "\*.txt objeet\temp"
CALL shell(eom$) CASE 92 ! read report CALL read_cut_report("temp") - W O 97/37317 PCTAUS97/05419 .-GET KEY getkey CASE 100 ! prototype CALL shell("c:\bc3 1\bin\rp-mt4") CASE ELSE
PRINT "Job is not available. Select again "
GET KEY key EXIT SELECT
END SELECT
LOOP
END
!************~
! End of file !******~******

CA 02250822 1998-lO-Ol - W O 97/37317 PCT~US97/05419 !********~***********************************************************
! Written by Cheol H. Lee ! File: 72-menu.tru ! Date: 6/96 ! Object: display menu, and read and save setup file ! Input: setup.rp ! Output: dispaly menu, setup.rp !**********************~*t~ ttt~************~4~ ****************
! M E~nU
! - 15 jop setup p~ t~ . . are save in object\setup.rp record file (rqm~$,mml_tri,rlh,Pn~l.o cr~q,ce_t,space b,d loop,d_point xmax,ymqx 7.mqY xh yh ~It?cimql e~ir) ! - Job setup p ~ . .. t~ . ~ can be changed in setup menu.
!************t~tt~tt~**************************~t~tt~**********
set mode "vga"
clear a=l if a=1 then call main menu (job) else call setup_menu(job) end if end EXTEFUNAL
!t~tt~t*~
! Summary (72-menu) !*********
! SUB status (nqm~$~n~m-tri~tlh~q~ e~cpa~e-t~space-b~d-loop~d_point,&
& xmax~ymqx~7m ! SUB main_menu(job) ! SUB setup_menu(~ob) ! SUB read_setup(name$,num_tri,dh,angle,space_t,space b,d_loop,d point,&
& xmax,ymqx"qmqx,xh,yh,decimal,skip) ! SUB save_setup(name$,num_tri,-1h qngl~ cp~qre_t,space_b,d_loop,d_point,&
& xmax,ymqx,7mqx xh yh,decimql ~l~jp) !***************~ *
! Subroutine: status !*~tttt~*t****************
SUB status (nqm~$, _tr~ hJpngll ~cpqre t,space_b,d_loop,d_point,&
& xmax~ymqx~7m~x~xh~yh~decimql~bir) ! all input ! display status window in main menu window ! name$, num_tri: object name. number of triangles ! dh, angle : foam thif l~n~es ~ x~l...l... cut angle ! space_t, space_b: space bw control point and top or bot surface ! d_loop, d_point: min distance bw loops. discrete point distance ! x,y,zmax: object size ! xh,yh : home position in x and y direction ! decimal, skip: round decimal. number of skip points.

CA 022~0822 1998-10-01 - W O g7137317 PCTrUS97/05419 --ASK free memory mem memory=round(mem/ 1000,1) IF dh'>0 THEN num slice=int(zmax/dh) OPEN #9:SCREEN 0.66,1,0,1 WINDOW #9 CLEAR
SET COLOR "red"
PR~NT "JOB SETUP "
PR~NT "*********************************~
PRINT " Object ";name$;",";num_tri;"tri"
PRINT " "
PRINT " Slices :";num_slice;"slices"
PRINT " Free memory :";memory;"Kb"
PRINT
PRINT " Loop gab :";d_loop;"cm"
PRINT " Point res :";d_point;"cm"
PRINT " Point skip :";skip;"pts"
PRINT " Decimal :";dec~mal;"place"
PRINT
PRINT " Cut angle :";angle;"degree"
PRINT " Foam :";dh;"cm"
PRINT " Bottom space:";space_b;"cm"
PRINT " Top space :";space_t;"cm"
PRINT
PRINT " home x,y :";xh;yh PRINT
PRINT " object x:";xmax;"cm"
PRINT " y:";ymax;"cm"
PRINT" z:";zmax;"cm"
END SUB
!******~****************
! Subroutine: main_menu !****#*#****************
SUB main_menu (job) ! i ! display main menu for job selection ! job: job selection SET BACK "black"
OPEN #I:SCREEN 0,0.33,0.1,1 OPEN #2:SCREEN 0.33,0.66,0.1,1 OPEN #3:SCREEN 0,1,0,0.1 !-- Istcolumn 11111111111111111111111111111111111111111111111 WINDOW # 1 CLEAR
SET COLOR "yellow"
PRINT "RP CONTROL SOFTWARE R72"
PRINT "by Cheol Lee "
PRINT

- WO97t37317 PCT~S97/05419 SETCOLOR "red"
PRINT "JOB LIST"
PRINT ~#*****************************1l SET COLOR "white"
PRINT " 0) Quit"
PR~NT " I ) DOS"
PRINT " 2) Job setup"
PRINT " 3) Combine STL"
PR~NT " 4) Append STL"
PRINT " 5) STL to object"
PRINT" 6) Select object"
PRINT " 7) Rotate object"
PRINT " 8) Resize object"
PRINT " 9) R(,~
SET COLOR "green"
PRINT "SLICE "
SET COLOR "white"
PRINT " 11) Object to a line "
PRINT" 12) Object to lines "
PRINT " 13) Lines to loops "
PRINT " 14) Loops to points "
PRINT" 15) Points to cuts"
PRINT " 16) Cuts to steps"
PRINT
PRlNT " 21) Remove loop "
PRINT " 22) Reverse loop "
PR~NT " 23) Points to cuts(SMl) "
!-- 2nd column WINDOW #2 CLEAR
SET COLOR ''Il.ag~ a'' PRINT " M~ lf~rt-~nng Lab "
PRINT " Univ. of Utah "
PRINT " "
BOX LINES 0,0.8,0.93,1 PR~T
PR~T
SET COLOR "green"
PRINT "READ "
SET COLOR "white"
PRINT " 41) Loop index"
PRINT " 42) Point index"
PRINT " 43) Cut index"
PRINT " 44) Coord file"
PRINT " 45) Create cut report"
PRINT " 46) Read cut report"
SET COLOR "green"
PRINT "AUTOMATIC VIEW"
SET COLOR "white"
PRINT " 51) Object"
PRINT " 52) Lines-3D"
PRINT " 53) Lines-2D"

CA 022~0822 1998-10-01 - W O 97137317 PCT~US97/05419 PRINT " 54) Loops"
PRINT " 55) Points"
PRINT " 56) Cuts"
PRINT " 57) Steps"
SET COLOR "green"
PRINT "SHAPE MAKER 2"
SET COLOR "white"
PRINT " 91) prepare "
PRINT " 92) check report"
PRINT " 100) ~lulul~c"
!-- question window WINDOW #3 CLEAR
SET COLOR "white"
INPUT PROMPT "Select a job: ":job CLEAR
END SUB
!*************************
! Sublulllulc. setup_menu !*********~ *******
SUB setup_menu(job) ! i ! display setup sub menu ! job: job selection in setup sub menu SET BACK "black"
OPEN #l:SCREEN 0,0.33,0.1,1 OPEN #2:SCREEN 0.33,0.66,0.1,1 OPEN #3:SCREEN 0,1,0,0.1 !-- lstcolumn 111111111111111111111111111111111111111111111 WINDOW #l CLEAR
SET COLOR "yellow"
PRINT "RP CONTROL SOFTWARE R67"
PRINT "by Cheol Lee "
PRINT
SET COLOR "red"
PRINT "JOB LIST"
PRINT "***********~******************~
SET COLOR "white"
PRINT " 0) Return to main menu"
PRINT
PRINT " 1) Foam thickness"
PRINT " 2) Max Cut angle "
PRINT " 3) Bottom space "
PRINT " 4) Top space "
PRINT
PRINT " 11) Min loop gab "
PRINT " 12) Point resolution"

CA 02250822 l998-lO-Ol W O 97/37317 PCT~US97/05419 .-PRINT " 13) Skip points "
PR~NT " 14) Decimal point "
PRINT
PRINT " 21) Home"
PRINT
PRINT " 31) Save setup"
!-- 2nd column WINDOW #2 CLEAR
SET COLOR "magenta"
PRINT " ~vlqn-lfqrtl-ring Lab "
PRINT " Univ. of Utah "
PRINT " "
BOX LINES 0,0.8,0.93,1 SET COLOR "white"
!-- 4uestion window WlNDOW #3 CLEAR
SET COLOR "white"
INPUT PROMPT "Select a job: ":job CLEAR
END SUB
!************************
! Subroutine: read_setup !************************
SUB read_setup (name$,num tri7(lh~qngl~cpq~e-t~space-b~d loop,d_point,& & xmax,ymqx 7mq-x,xh yh,decirnal,skip) ! all input ! read setup pa~ in setup.rp file ! name$, num_tri: object name. number of triangles ! dh, angle : foam thi~ knt~cc mqxim-lm cut angle ! space_t, space b: space bw control point and top or bot surface ! d_loop, d_point: min distance bw loops. discrete point distance ! x,y,_max: object si_e ! xh,yh : home position in x and y direction ! decimal, skip: round decimal. number of skip points.
OPEN #l:name "object\setup.rp",create newold,access outin, org record RESET #l :Begin WHEN error IN
READ#l:name$,num tri,-lhqn~ cp~e_t,space_b,d_loop,d~oint READ #1:xmax,ymqx 7.mqx READ # I :xh,yh,decimal,skip USE
exit sub END WHEN
CLOSE #l END SUB

!************************
! Subroutine: save_setup ! *************~ t*****
SUB save_setup(name$,num_tri,~1h"qngl~ space_t,space b,d_loop,d_point,& & xmax,yrn~ 7.mqx ~h,yh,decimal,skip) ! all input ! save current setup p ~ .t ...~ in setup.rp file ! name$, num_tri: object name. number of triangles ! dh, angle : foam thirl~nr$5 ~ x i.. cut angle ! space_t, space_b: space bw control point and top or bot surface ! d_loop, d_point: min distance bw loops. discrete point distance ! x,y,zmax: object si_e ! xh,yh : home position in x and y direction ! decimal, skip: round decimal. number of skip points.
OPEN #1 :name "object\setup.rp",create newold,access outin, org record ERASE#I
SET#I:RECSIZE10 RESET # I :Begin ~nUTE#l:name$,num_tri,~h,qnglr,~r-q-re_t,space_b,d_loop,d_point unuTE#l:xmax~ymqy~7mq~
UnUTE#l:xh,yh~rci~ql~Q~ir END SUB
!*************
! End of File !*************

Claims (11)

-118-What is claimed is:
1. In a rapid prototype system wherein an electronic model of an object is electronically decomposed into a first series of electronic layers, a second series of physical layers is generated from a construction material, said second seriescorresponding layer by layer to said first series, and a physical prototype of that object is then constructed by assembling said physical layers, the improvement which comprises:
a. electronically decomposing said object into said first series of electronic layers in accordance with a paradigm characterized by a higher than zero order fit with respect to the surface of said object; and b. generating said second series of physical layers from said construction material by mechanical means constructed and arranged to operate in accordance with said paradigm.
2. An improvement according to Claim 1 wherein said paradigm has a higher order of fit than that of the vertical cylinder paradigm (VCP).
3. An improvement according to Claim 2, wherein said paradigm is selected from either the trapezoidal cylinder paradigm (TCP) or the arc cylinderparadigm (ACP).
4. An improvement according to Claim 1, wherein said steps a and b are conducted by means controlled by software equivalent to that set forth on pages 14 through 117.
5. A rapid prototype system, comprising:
electronically decomposing an electronic model of an object into a first series of electronic layers in accordance with a paradigm characterized by a higher than zero order fit with respect to the surface of said object;
generating a second series of physical layers from a construction material by mechanical means constructed and arranged to operate in accordance with said paradigm, said second series corresponding layer by layer to said first series; and constructing a physical prototype of said object by assembling said physical layers.
6. A rapid prototype system according to Claim 5, wherein said mechanical means is structured and arranged to provide four degrees of freedom in positioning a cutting device with respect to sheets of said construction material.
7. A rapid prototype system according to Claim 6, wherein said mechanical means is constructed and arranged to accept and manipulate sheets of construction material 1.22 meters (four feet) wide.
8. A rapid prototype system according to Claim 6, wherein said mechanical means is operated by control means responsive to software equivalent to that set forth at pages 14 through 117.
9. A rapid prototype system according to Claim 6, wherein said mechanical means includes:
a support structure, operable to move a sheet of construction material forwards and backwards along a travel path in a plane;
an electronically heated wire with a first end held by a first linear positioning device and a second end held by a second linear positioning device, said first and second positioning devices being supported to position said wire transverse said plane to intersect and cut a sheet of construction material traveling on said support structure;
first structure, mounting said first positioning device such that it may travel back and forth transverse said travel path;
second structure, mounting said second positioning device such that it may travel independently of said first positioning device back and forth transverse said travel path; and electronic control means, responsive to operating software, for controlling the relative movements of a sheet of construction material on said support structure, said first positioning means and said second positioning means.
10. A rapid prototype system according to Claim 9, including heat control means, responsive to said operating software, constructed and arranged to adjust the temperature of said wire.
11. A rapid prototype system according to Claim 9, wherein said operating software is equivalent to that set forth at pages 14 through 117.
CA002250822A 1996-04-01 1997-04-01 Higher order construction algorithm method for rapid prototyping Abandoned CA2250822A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US08/625,142 1996-04-01
US08/625,142 US5818718A (en) 1996-04-01 1996-04-01 Higher order construction algorithm method for rapid prototyping

Publications (1)

Publication Number Publication Date
CA2250822A1 true CA2250822A1 (en) 1997-10-09

Family

ID=24504774

Family Applications (1)

Application Number Title Priority Date Filing Date
CA002250822A Abandoned CA2250822A1 (en) 1996-04-01 1997-04-01 Higher order construction algorithm method for rapid prototyping

Country Status (4)

Country Link
US (1) US5818718A (en)
EP (1) EP0922265A1 (en)
CA (1) CA2250822A1 (en)
WO (1) WO1997037317A1 (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5879489A (en) 1993-11-24 1999-03-09 Burns; Marshall Method and apparatus for automatic fabrication of three-dimensional objects
US6305769B1 (en) * 1995-09-27 2001-10-23 3D Systems, Inc. Selective deposition modeling system and method
US7620527B1 (en) * 1999-05-10 2009-11-17 Johan Leo Alfons Gielis Method and apparatus for synthesizing and analyzing patterns utilizing novel “super-formula” operator
US6324438B1 (en) 1999-05-11 2001-11-27 North Carolina State University Methods and apparatus for rapidly prototyping three-dimensional objects from a plurality of layers
US6627835B1 (en) 2000-02-02 2003-09-30 Purdue Research Foundation Three dimensional object fabrication techniques
US6609043B1 (en) 2000-04-25 2003-08-19 Northrop Grumman Corporation Method and system for constructing a structural foam part
US6654656B2 (en) 2001-03-06 2003-11-25 The Research Foundation Of State University Of New York Rapid informational prototypes, including rapid colored prototypes
US7272254B2 (en) * 2003-07-09 2007-09-18 General Electric Company System and method for analyzing and identifying flaws in a manufactured part
US8904644B2 (en) 2008-07-17 2014-12-09 Systeco (Cayman) Ltd Secz Portable foam panel cutting machine
WO2011028271A2 (en) * 2009-09-04 2011-03-10 Bayer Materialscience Llc Automated processes for the production of polyurethane wind turbine blades
WO2011137443A1 (en) * 2010-04-30 2011-11-03 The Trustees Of The University Of Pennsylvania Methods for developing breast phantoms
AU2013318708A1 (en) 2012-09-24 2015-04-09 The Antenna Company International N.V. Lens antenna, method of manufacturing and using such an antenna, and antenna system
WO2014123560A1 (en) * 2013-02-08 2014-08-14 Systeco (Cayman) Ltd Secz Portable foam panel cutting machine
US10128572B2 (en) 2014-03-26 2018-11-13 The Antenna Company International N.V. Patch antenna, method of manufacturing and using such an antenna, and antenna system
CN106488819B (en) 2014-06-20 2018-06-22 维洛3D公司 For the equipment, system and method for 3 D-printing
US10065270B2 (en) 2015-11-06 2018-09-04 Velo3D, Inc. Three-dimensional printing in real time
US10071422B2 (en) 2015-12-10 2018-09-11 Velo3D, Inc. Skillful three-dimensional printing
US20170239891A1 (en) 2016-02-18 2017-08-24 Velo3D, Inc. Accurate three-dimensional printing
US11691343B2 (en) 2016-06-29 2023-07-04 Velo3D, Inc. Three-dimensional printing and three-dimensional printers
US10286452B2 (en) 2016-06-29 2019-05-14 Velo3D, Inc. Three-dimensional printing and three-dimensional printers
US20180126462A1 (en) 2016-11-07 2018-05-10 Velo3D, Inc. Gas flow in three-dimensional printing
US10611092B2 (en) 2017-01-05 2020-04-07 Velo3D, Inc. Optics in three-dimensional printing
US10369629B2 (en) 2017-03-02 2019-08-06 Veo3D, Inc. Three-dimensional printing of three-dimensional objects
US20180281283A1 (en) 2017-03-28 2018-10-04 Velo3D, Inc. Material manipulation in three-dimensional printing
US10272525B1 (en) 2017-12-27 2019-04-30 Velo3D, Inc. Three-dimensional printing systems and methods of their use
US10144176B1 (en) 2018-01-15 2018-12-04 Velo3D, Inc. Three-dimensional printing systems and methods of their use

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4665492A (en) * 1984-07-02 1987-05-12 Masters William E Computer automated manufacturing process and system
US5287435A (en) * 1987-06-02 1994-02-15 Cubital Ltd. Three dimensional modeling
US5121329A (en) * 1989-10-30 1992-06-09 Stratasys, Inc. Apparatus and method for creating three-dimensional objects
JPH0773884B2 (en) * 1990-05-02 1995-08-09 三菱商事株式会社 Light solidification modeling device
US5506607A (en) * 1991-01-25 1996-04-09 Sanders Prototypes Inc. 3-D model maker
US5510066A (en) * 1992-08-14 1996-04-23 Guild Associates, Inc. Method for free-formation of a free-standing, three-dimensional body
US5398193B1 (en) * 1993-08-20 1997-09-16 Alfredo O Deangelis Method of three-dimensional rapid prototyping through controlled layerwise deposition/extraction and apparatus therefor
US5432704A (en) * 1993-11-23 1995-07-11 Clemson University Adaptive lamina generation for shape dependent process control and/or object decomposition

Also Published As

Publication number Publication date
US5818718A (en) 1998-10-06
EP0922265A1 (en) 1999-06-16
WO1997037317A1 (en) 1997-10-09

Similar Documents

Publication Publication Date Title
CA2250822A1 (en) Higher order construction algorithm method for rapid prototyping
WO1997037317A9 (en) Higher order construction algorithm method for rapid prototyping
Kruth Material incress manufacturing by rapid prototyping techniques
US5663883A (en) Rapid prototyping method
EP1912477B1 (en) Manufacturing methods and systems for rapid production of hearing-aid shells
Beaman et al. Solid freeform fabrication: a new direction in manufacturing
Sun et al. Adaptive direct slicing of a commercial CAD model for use in rapid prototyping
Yan et al. A review of rapid prototyping technologies and systems
EP0355945B1 (en) Reduced stereolithographic part distortion through isolation
US11718036B2 (en) Interactive slicing methods and systems for generating toolpaths for printing three-dimensional objects
JP5030962B2 (en) Transaction method for building 3D objects
Kulkarni et al. On the integration of layered manufacturing and material removal processes
Dutta et al. Layered manufacturing: current status and future trends
US20060200269A1 (en) Automated engraving of a customized jewelry item
US6654656B2 (en) Rapid informational prototypes, including rapid colored prototypes
EP1170115B1 (en) Stereolithography contour smoothing method
CN107627610A (en) Information processor, moulding system, recording medium, data processing method
Ramaswami Process planning for shape deposition manufacturing
WO2009044362A2 (en) A method of manufacturing wing structures.
EP3482914A1 (en) Method for determining the inclination of the axes of a machine with five or more axes for producing objects by additive manufacturing, system for producing objects by said method
US6146487A (en) Rapid prototyping method for minimizing post processing
JP2002236710A (en) Data processor, data processing method, recording medium and program
JP3684847B2 (en) Solid model generation support device
JPH11184902A (en) Method for producing model through rapid prototyping device based on three-dimensional plotting data of object generated by three-dimensional graphics processing and rapid prototyping device
JP2002264222A (en) Data processing apparatus and method, recording material and program

Legal Events

Date Code Title Description
FZDE Discontinued