Action:
|
Deep copies an entity (solid, face, edge, etc.) plus all attached entities.
|
|
Filename:
|
kern/kern_scm/ent_scm.cxx
|
|
APIs:
|
api_deep_copy_entity_list, api_pm_add_entity
|
|
Syntax:
|
(entity:deep-copy entity-list [part] [deepcopy-skip=#f])
|
|
Arg Types:
|
entity-list
|
entity | (entity ... )
|
|
part
|
part
|
|
deepcopy-skip
|
boolean
|
|
Returns:
|
entity | (entity ... )
|
|
Description:
|
The difference between
entity:deep-copy and
entity:copy is that
entity:deep-copy makes a copy of
splf_splf, whereas
entity:copy creates a pointer to
splf_splf.
|
|
|
The deep copy functionality is used instead of the regular copy when it is required that no links exist with shared information between the original and the deep copy.
|
|
|
entity-list is any entity or list of entities to be deep copied. If an entity is removed, use the
view:refresh extension to display remaining entities. If a single entity is specified, a single entity is returned, which is the deep copy. If an entity list is specified, a list of entities is returned.
|
|
|
part is an optional argument. If
part is specified, the deep copies are added to the
part; otherwise, the deep copies are added to the part that contained the original entity.
|
|
|
If
deepcopy-skip is #t, the copy will continue even after encountering attributes marked as not deep copyable. The default is to throw a
sys_error if such a case is encountered.
|
|
Example:
|
; entity:deep-copy
|
|
; Create .
|
|
(define block1
|
|
|
(solid:block (position 0 0 0)
|
|
|
(position 20 20 20)))
|
|
;; block1
|
|
; Create a cylinder.
|
|
(define cyl2
|
|
|
(solid:cylinder (position 0 0 0)
|
|
|
(position 5 5 10) 5))
|
|
;; cyl2
|
|
; Create another block.
|
|
(define block3
|
|
|
(solid:block (position 0 0 0)
|
|
|
(position -10 -10 -10)))
|
|
;; block3
|
|
; Conduct the deep copy on the three entities.
|
|
(define deepcopy (entity:deep-copy (list block1
|
|
|
cyl2 block3)))
|
|
;; deepcopy
|