cell:flatten
List of: Scheme Extensions
Subjects: Cellular Topology
Contents: Cellular Topology

Action: Flattens the cellular topology by removing any supercells.

Filename: ct/ct_scm/cell_scm.cxx

APIs: api_ct_flatten

Syntax: (cell:flatten entity-list)

Arg Types: entity-list entity | (entity ... )

Returns: entity ...

Description: The cell:expand extension expands the cells in the sheet or solid bodies in the entity-list into supercells. The cell:flatten extension removes any supercells from the cellular topology attached to each sheet or solid body in the input entity-list. The return value is the input list.

Example: ; cell:flatten

; Create a solid sphere.

(define sphere1 (solid:sphere (position 0 0 0) 30))

;; sphere1

; Attach the sphere to a cell.

(define cell1 (cell:attach sphere1))

;; cell1

; Expand the cells into supercells.

(define expand (cell:expand sphere1))

;; expand

; Remove any supercells from the cellular topology.

(define flatten (cell:flatten sphere1))

;; flatten


; cell:flatten

; Additional example,

; Create a lattice with more cells.

(define lattice1 (letrec


((loop (lambda (one two three acc)



(if (= one 3)




(apply bool:nonreg-unite acc)




(if (= two 3)





(loop (+ one 1) 0 0 acc)





(if (= three 3)






(loop one (+ two 1) 0 acc)







(let ((org-pos








(position (* one 5)








(* two 5)








(* three 5))))






(loop one two (+ three 1)







(cons (solid:block org-pos








(position:offset org-pos








(gvector 10 10 10)))




acc))))))))) (loop 0 0 0 '())))

;; lattice1

(define cells1 (cell:attach lattice1))

;; cells1

; Expand the cells into supercells.

(define expand1 (cell:expand lattice1))

;; expand1

; Remove any supercells from the cellular topology.

(define flatten (cell:flatten lattice1))

;; flatten
PDF/CT/02SC.PDF
HTM/DATA/CT/CT/02SC/0009.HTM