Action:
|
Returns the name of the selected entity as determined by an attached annotation attribute.
|
|
Filename:
|
kern/kern_scm/anno_scm.cxx
|
|
Syntax:
|
(entity:annotation-names entity)
|
|
Arg Types:
|
entity
|
entity
|
|
Returns:
|
(string ...)
|
|
Description:
|
Returns the names of the selected entity as determined by an attached annotation attributes.
|
|
|
The option for "annotation" should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for "unhook_annotations" should be turned off (#f) in order to view the annotations after the operation, otherwise they are automatically cleared out.
|
|
|
entity is an entity that should have the member-name within the candidate annotation.
|
|
Example:
|
; entity:annotation-names
|
|
; Turn on annotation options
|
|
(option:set "annotation" #t)
|
|
;; #f
|
|
(option:set "unhook_annotations" #f)
|
|
;; #t
|
|
; Create a sweep path from a wire body of edges.
|
|
(define path1 (wire-body (list (edge:linear
|
|
|
|
(position 0 0 0) (position 0 20 0))
|
|
|
(edge:ellipse (position 10 20 0)
|
|
|
|
(gvector 0 0 -1) (gvector -10 0 0) 1 0 90)
|
|
|
(edge:linear (position 10 30 0)
|
|
|
|
(position 20 30 0)))))
|
|
;; path1
|
|
; Create the profile to use in sweeping
|
|
(define profile1 (wire-body:points (list
|
|
|
(position 3 0 3) (position 3 0 -3)
|
|
|
(position -3 0 -3) (position -3 0 3)
|
|
|
(position 3 0 3))))
|
|
;; profile1
|
|
; Sweep the profile along the path.
|
|
(define sweep1 (sweep:law profile1 path1))
|
|
;; sweep1
|
|
(entity:set-color path1 2)
|
|
;; ()
|
|
(entity:set-color profile1 3)
|
|
;; ()
|
|
(iso)
|
|
;; #[view 10814340]
|
|
(zoom-all)
|
|
;; #[view 10814340]
|
|
; Create some lists for verification purposes.
|
|
(define out-sw-faces (entity:faces sweep1))
|
|
;; out-sw-faces
|
|
(define out-sw-edges (entity:edges sweep1))
|
|
;; out-sw-edges
|
|
; Select a face resulting from the sweep.
|
|
(ray:queue 89.9693 -121.78 74.672 -0.408248
|
|
|
0.816497 -0.408248 1)
|
|
;; #[ray (89.9693 -121.78 74.672)
|
|
;;
|
(-0.408248 0.816497 -0.408248)]
|
|
(define face1 (pick-face))
|
|
;; face1
|
|
(entity:set-color profile1 2)
|
|
;; ()
|
|
(entity:set-color face1 BLUE)
|
|
;; ()
|
|
(system:sleep 3500)
|
|
;; 3500
|
|
; Get the annotations associated with the face.
|
|
(define face1_annos (entity:annotations face1))
|
|
;; face1_annos
|
|
(define anno1 (list-ref face1_annos 0))
|
|
;; anno1
|
|
(entity:debug anno1)
|
|
;; "sweep_anno_edge_lat"
|
|
; Get the inputs for this annotation.
|
|
(define anno1_inputs (annotation:inputs anno1))
|
|
;; anno1_inputs
|
|
(define edge1 (list-ref anno1_inputs 0))
|
|
;; edge1
|
|
(annotation:member-name anno1 edge1)
|
|
;; "profile"
|
|
(entity:set-color edge1 6)
|
|
;; ()
|
|
(define edge2 (list-ref anno1_inputs 1))
|
|
;; edge2
|
|
(annotation:member-name anno1 edge2)
|
|
;; "path"
|
|
; Get the outputs for this annotation
|
|
(define anno1_outputs (annotation:outputs anno1))
|
|
;; anno1_outputs
|
|
(annotation:member-name anno1
|
|
|
(list-ref anno1_outputs 0))
|
|
;; "lateral_face"
|
|
(annotation:member-name anno1 face1)
|
|
;; "lateral_face"
|
|
; Find member names of a specific entity for
|
|
; all the associated annotations.
|
|
(entity:annotation-names edge1)
|
|
;; ("profile" "profile" "profile" "profile")
|
|
(entity:annotation-names edge2)
|
|
;; ("path" "path" "path" "path" "path" "path" "path"
|
|
;;
|
"path" "path" "path" "path" "path" "path" "path"
|
|
;;
|
"path" "path")
|