graph:subgraph-2dcell
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Selective Booleans

Action: Returns a subgraph containing only the vertices that are 2D cells.

Filename: sbool/sbool_scm/selective_scm.cxx

APIs: api_subgraph_2dcell

Syntax: (graph:subgraph-2dcell whole-graph [acis-opts])

Arg Types: whole-graph graph

acis-opts acis-options

Returns: graph


whole-graph is an input argument.


The optional acis-opts contains parameters for versioning and journaling.

Example: ; graph:subgraph-2dcell

; Create entities

(define b1 (solid:block (position -40 0 0)


(position 40 10 10)))

;; b1

(define b2 (solid:block (position 30 -10 -10)


(position 45 20 20)))

;; b2

(define face1 (face:planar-disk (position -10 0 0)


(gvector 1 0 0) 20))

;; face1

(define sheet1 (sheet:face face1))

;; sheet1

(define sh2d-1 (sheet:2d sheet1))

;; sh2d-1

(define face2 (face:planar-disk (position -30 0 0)


(gvector 1 0 0) 20))

;; face2

(define sheet2 (sheet:face face2))

;; sheet2

(define sh2d-2 (sheet:2d sheet2))

;; sh2d-2

(define face3 (face:planar-disk (position -20 15 0)


(gvector 0 1 0) 30))

;; face3

(define sheet3 (sheet:face face3))

;; sheet3

(define sh2d-3 (sheet:2d sheet3))

;; sh2d-3

(define e (bool:nonreg-unite b1 b2 sh2d-1 sh2d-2


sh2d-3))

;; e

(define plane-pos (position -20 0 0))

;; plane-pos

(define plane-normal (gvector 1 0 0))

;; plane-normal

(define imprint-face (face:planar-disk


plane-pos plane-normal 50))

;; imprint-face

(define imprint-sheet (sheet:face imprint-face))

;; imprint-sheet

(define sh2d-4 (sheet:2d imprint-sheet))

;; sh2d-4

(define sol-im1 (solid:imprint e imprint-sheet))

;; sol-im1

(cell:attach e)

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

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

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

;; #[entity 21 1])

(define g (graph (entity:cells e)))

;; g

(define g-2d (graph:subgraph-2dcell g))

;; g-2d

(define g-3d (graph:subgraph-3dcell g))

;; g-3d
PDF/SBOOL/02SC.PDF
HTM/DATA/SBOOL/SBOOL/02SC/0006.HTM