pattern:check
List of: Scheme Extensions
Subjects: Patterns
Contents: Kernel

Action: Lists the elements in an entity that have a pattern attached.

Filename: kern/kern_scm/pattern_scm.cxx

APIs: api_get_coedges, api_get_edges, api_get_faces, api_get_loops, api_get_lumps, api_get_shells, api_get-vertices, api_get_wires

Syntax: (pattern:check entity [type-list] [color])

Arg Types: entity entity

type-list string | (string ...)

color boolean

Returns: boolean

Description: Checks for the presence of patterns on the BODY, LUMPs, SHELLs, FACEs, and LOOPs of an entity and generates a list of the elements with patterns. Returns #t when elements with patterns exist and #f when there are no elements with patterns.


entity specifies an entity.


Defining type-list ('bodies, 'lumps, 'shells, 'faces, or 'loops) generates a more selective check. By default, the function checks all entities.


If color is specified as #t, the faces, edges, and vertices that are patterned are colored in the display.

Example: ; pattern:check

; Create a sphere at the origin to demonstrate

; command.

(define s (solid:sphere (position 0 0 0) 10))

;; s

; Define a 2x2 hex pattern.

(define p (pattern:hex (gvector 0 1 1)


(gvector 40 0 0) 2 2))

;; p

; Create an entity using sphere in the pattern.

(define hexpat (entity:pattern s p))

;; hexpat

; Check that hexpat is a pattern.

(pattern:check hexpat)

; entities with patterns:

;

1 bodies

;

4 lumps

;

4 shells

;

0 wires

;

4 faces

;

4 surfaces

;

1 loops

;

0 coedges

;

0 pcurves

;

0 edges

;

0 curves

;

0 vertices

;

0 points

;

All entities examined have patterns

;; #t

; Check faces only.

(pattern:check hexpat 'faces)

;
face: (entity 11 1)

;
face: (entity 12 1)

;
face: (entity 13 1)

;
face: (entity 14 1)

; entities with patterns:

;
4 faces

; All entities examined have patterns

;; #t


PDF/KERN/14SCI.PDF
HTM/DATA/KERN/KERN/14SCI/0053.HTM