Action:
|
Projects (part of) an edge onto a face.
|
|
Filename:
|
kern/kern_scm/qedg_scm.cxx
|
|
APIs:
|
api_project_curve_to_surface
|
|
Syntax:
|
(edge:project-to-face in-edge in-face)
|
|
Arg Types:
|
in-edge
|
edge
|
|
in-face
|
face
|
|
Returns:
|
edge
|
|
Description:
|
Only that part of the edge for which a perpendicular projection onto the face's surface exists will be projected - parts that can only be projected to the boundaries of the surface will be excluded. If no part of the edge can be projected onto the surface, this extension will return
False.
|
|
|
in-edge specifies the edge to project.
|
|
|
in-face specifies a face.
|
|
Limitations:
|
If there is more than one segment of the edge that can be projected onto the surface, the api will fail.
|
|
Example:
|
; edge:project-to-face
|
|
; Create some geometry to show the example of
|
|
; projecting an edge to a face.
|
|
(cond (( = 0 (length (part:views))) (view:gl)))
|
|
;; f
|
|
(view:set-bg-color 7)
|
|
;; #[view 5375148]
|
|
(view:edges #t)
|
|
;; #[view 5375148]
|
|
(view:polygonoffset #t)
|
|
;; #[view 5375148]
|
|
(part:clear)
|
|
;; #t
|
|
; Make a spring edge
|
|
(define handiness #t)
|
|
;; handiness
|
|
(define pitch1 40)
|
|
;; pitch1
|
|
(define pitch-degrees1 360)
|
|
;; pitch-degrees1
|
|
(define axis-point (position 0 0 0)))
|
|
;; axis-point
|
|
(define axis-vector(gvector 0 1 0))
|
|
;; axis-vector
|
|
(define start-position (position 0 0 6))
|
|
;; start-position
|
|
(define spring (edge:spring axis-point axis-vector
|
|
|
start-position handiness pitch1 pitch-degrees1))
|
|
;; spring
|
|
; Make a face
|
|
(define c (solid:cylinder
|
|
|
(position 0 0 0)
|
|
|
(position 0 50 0) 5))
|
|
;; c
|
|
(entity:set-color c RED)
|
|
;; ()
|
|
(define f(list-ref (entity:faces c ) 0))
|
|
;; f
|
|
(zoom-all)
|
|
;; #[view 5375148]
|
|
; Make an edge that is the first edge projected onto
|
|
; the face
|
|
(define newcurve (edge:project-to-face spring f))
|
|
;; newcurve
|