|
Many examples produce
entity objects, and then use them. For example:
|
|
|
(solid:block (position 0 0 0) (position 10 10 10))
|
|
;; #[entity 2 1]
|
|
|
The
solid:block extension creates an
entity.
Scheme AIDE maintains the external representation of this entity as
#[entity 1 1], where 1 is the entity ID, and 0 is the part ID. Subsequent operations that require this entity as input, such as
entity:faces, would require the external representation.
|
|
|
(entity:faces (entity 1))
|
|
;; (#[entity 2 1]#[entity 3 1]#[entity 4 1]
|
|
;; #[entity 5 1]#[entity 6 1]#[entity 7 1])
|
|
|
Note
|
Do not confuse the external representation of an entity, as in #[entity 2 1], with the Scheme extension called entity. The external representation is simply a diagnostic output showing what the extension returned. The entity extension accepts an ID number and returns the object.
|
|
|
Scheme AIDE maintains its own entity numbering for each session. The entity numbers are not always freed up even after the entity is deleted. If an entity is passed into another operation, there are no guarantee that the entity numbers be the same. The way around this is to use
define statements and your own variable names. The variable names are then passed into subsequent operations. In this manner, the same set of operations can be performed over and over within the same
Scheme AIDE session without having to worry about specific entity numbers.
|
|
|
(define my_block (solid:block
|
|
(position 0 0 0) (position 10 10 10)))
|
|
;; my_block
|
|
; my_block => #[entity 1 1]
|
|
(entity:faces my_block)
|
|
;; (#[entity 2 1]#[entity 3 1]#[entity 4 1]
|
|
;; #[entity 5 1]#[entity 6 1]#[entity 7 1])
|