graph:edge-entities
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Returns a list of model entities associated with the graph edges.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:edge-entities in-graph)

Arg Types: in-graph graph

Returns: (entity...)

Description: The edges of a graph can have entities associated with them. An example of this is the case of a wirebody. In a wirebody, the vertices of the wireframe become vertices in the graph while the edges of the wirebody become edges in the graph.


in-graph specifies a graph.

Example: ; graph:edge-entities

; Create an example using entities.

(define e1 (edge:linear (position 10 10 0)


(position 10 -10 0)))

;; e1

(define e2 (edge:linear (position 10 -10 0)


(position -10 -10 0)))

;; e2

(define e3 (edge:linear (position -10 -10 0)


(position -10 10 0)))

;; e3

(define e4 (edge:linear (position -10 10 0)


(position 10 10 0)))

;; e4

(define g1 (graph (list e1 e2 e3 e4)))

;; g1

(graph:edge-entities g1)

;; (#[entity 5 1] #[entity 4 1] #[entity 3 1]

;; #[entity 2 1])

(graph:vertex-entities g1)

;; (#[entity 6 1] #[entity 7 1] #[entity 8 1]

;; #[entity 9 1] #[entity 10 1] #[entity 11 1]

;; #[entity 12 1] #[entity 13 1])

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


(position 5 10 15)))

;; b1

(define faces1 (entity:faces b1))

;; faces1

; Turn the block faces into vertices of the graph.

(define g2 (graph faces1))

;; g2

; (entity 16 65536)-(entity 19 65536)

(graph:edge-entities g2)

;; ()

(graph:vertex-entities g2)

;; (#[entity 20 1] #[entity 19 1] #[entity 18 1]

;; #[entity 17 1] #[entity 16 1] #[entity 15 1])

(define g3 (graph:unite g1 g2))

;; g3

(graph:edge-entities g3)

;; (#[entity 2 1] #[entity 3 1] #[entity 4 1]

;; #[entity 5 1])

(graph:vertex-entities g3)

;; (#[entity 13 1] #[entity 12 1] #[entity 11 1]

;; #[entity 10 1] #[entity 9 1] #[entity 8 1]

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

;; #[entity 16 1] #[entity 17 1] #[entity 18 1]

;; #[entity 19 1] #[entity 20 1])
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0044.HTM