Action:

Returns the angle between edges. Returns a list of angles if a nonbranched wirebody is submitted.


Filename:

kern/kern_scm/find_scm.cxx


APIs:

api_get_edges


Syntax:

(find:angle input1 [input2] [logical])


Arg Types:

input1

vertex  edge  wirebody


input2

edge


logical

real


Returns:

real  (real ...)



input1 specifies a vertex, edge or a wirebody. A vertex as
input1 computes the angles between the two edges around the vertex. If
input1 is a closed edge, the angle between the start and end is returned. If
input1 is a nonbranched, wirebody, a list of angles between each of the edges of the wirebody is returned.



input2 specifies an edge.
input2 must be supplied if
input1 is an open edge. The angle between these two edges is returned.



A
logical of false (#f) returns the results in radians, the default is degrees.


Limitations:

Success is not guaranteed for branched wirebodies, edges that do not share a vertex, and vertices with more than two edges.


Example:

; find:angle


; Create an entity


(define p1 (wirebody:polygon



(position 0 0 0) (gvector 0 1 0)



(gvector 0 0 1) 5))


;; p1


(define p2 (wirebody:polygon



(position 0 2 0) (gvector 0 1 0)



(gvector 0 0 1) 5))


;; p2


(define unite (bool:unite p1 p2))


;; unite


(zoomall)


;; #[view 25363466]


(define v (listref (entity:vertices p1)3))


;; v


(entity:setcolor v 1)


;; ()


(find:angle v)


;; 108.0
