graph
List of: Scheme Data Types
Subjects: Graph Theory
Contents: Scheme Support

Description: A graph is used to implement graph theory in ACIS. A graph is composed of vertices and edges. Edges are represented as a dash (-) between a pair of vertices. Vertices are represented as strings. Cells or faces of a model can be mapped into a graph structure. Each cell or model face is represented as a vertex, while connectivity between cells or model faces are represented as edges. There are several graph operations available for ordering and querying the graph structure.

Derivation: graph : scheme-object

C++ Type: generic_graph

External Rep: #[graph "..."]

where strings represent vertices of the graph and dashes (-) between pairs of vertices represent edges of the graph.

Example: ; graph (data type)

; Create a simple example

(define g1 (graph "me-you us-them"))

;; g1

; g1

; Create an example using entities.

(define b1 (solid:block (position -5 -10 -20)


(position 5 10 15)))

;; b1

; b1

(define faces1 (entity:faces b1))

;; faces1

; faces1 => (#[entity 3 1] #[entity 4 1]

; #[entity 5 1] #[entity 6 1] #[entity 7 1]

; #[entity 8 1])

; Turn the block faces into vertices of the graph.

(define g3 (graph faces1))

;; g3

; g3 => #[graph "(Face 5)-(Face 4) (Face 4)-(Face 3)

; (Face 5)-(Face 2) (Face 3)-(Face 2)

; (Face 4)-(Face 1) (Face 3)-(Face 1)

; (Face 2)-(Face 1) (Face 5)-(Face 1)

; (Face 2)-(Face 0) (Face 3)-(Face 0)

; (Face 4)-(Face 0) (Face 5)-(Face 0)"]
PDF/SCM/09SD.PDF
HTM/DATA/SCM/SCM/09SD/0031.HTM