Home > User Guide > Creating and Modifying Models
Creating and Saving Edges
The first examples create some simple line (edge) entities that can be viewed, saved, and restored. Edges are the simplest topologic elements that are visible. Even though it is possible to create lower level geometric elements, such as curves, these must be attached to some topologic element in order to be displayed.
The following example builds on the view creation example by adding more edges and saving these to a SAT file, called tmpedge.sat. It defines Scheme variables for the positions in order to allow the same positions to be used in multiple operations without reentry of the data.
Scheme Example
; Create a view for display.
(define my_view (view:dl))
;; my_view
; Define the positions to be used.
(define my_point1 (position 0 0 0))
; my_point1
(define my_point2 (position 25 0 0))
; my_point2
; Create edge 1.
(define my_linear (edge:linear my_point1 my_point2))
;; my_linear
; Create edge 2.
(define my_semi_circ (edge:circular my_point1 25 0 270))
;; my_semi_circ
; Create a law for one of the edges.
(define my_law (law "vec( 5*sin(x), x, 0)"))
;; my_law
; Create a sine edge.
(define my_sine (edge:law my_law 0 10))
;; my_sine
; Save the results to an output file.
(part:save "tmpedge1.sat")
;; #tAs example shows, a model can be saved in Scheme AIDE using the part:save Scheme extension. Similarly, a model can be loaded using part:load.
Some of the Scheme extensions available for creating various edge types are:
- edge:bezier
- Creates a cubic bezier curved edge from four control points.
- edge:circular/dt>
- Creates an arc with the specified center position and radius.
- edge:circular-3curve
- Creates an edge specified by an edge:circular tangent to three curves.
- edge:circular-3pt
- Creates an arc passing through three positions.
- edge:circular-center-rim
- Creates an arc given a center position and one or two positions on the arc.
- edge:circular-diameter
- Creates an arc passing through two positions based on the diameter.
- edge:conic
- Creates a rho conic edge in which the geometrical definition represents a hyperbola or parabola.
- edge:elliptical
- Creates a full or partial ellipse by specifying the start and end angles.
- edge:law
- Creates an edge whose characteristics are determined by a given law.
- edge:linear
- Creates a linear edge between two locations.
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.