Action:
|
Insert a ruled face which tangentially meets the supplied face, and which covers the region that is in the shadow cast from a light source.
|
|
Filename:
|
lop/lop_scm/lop_scm.cxx
|
|
APIs:
|
api_shadow_taper_faces
|
|
Syntax:
|
(lop:shadow-taper-faces face-list direction
|
|
|
angle [box-h box-l] [acis-opts])
|
|
Arg Types:
|
face-list
|
face | (face ...)
|
|
direction
|
gvector
|
|
angle
|
real
|
|
box-h
|
position
|
|
box-l
|
position
|
|
acis-opts
|
acis-options
|
|
Returns:
|
body
|
|
Errors:
|
In addition to the following, refer to the Errors listed for the Scheme extension,
lop:tweak-faces.
|
|
|
|
Some of the following errors result in an ENTITY, which indicates where the error occurs, being highlighted. The ENTITY type follows the error message below.
|
|
|
|
Valid direction must be supplied, or error;
|
|
|
LOP_TAP_BAD_NORMAL
|
|
Valid angle (at least 0 and less than 90 degrees) must be supplied or error;
|
|
|
LOP_TAP_BAD_ANGLE
|
|
Surface must be able to be tapered as requested, or error;
|
|
|
LOP_TAP_NO_SURF
|
|
|
|
Note that entities returned in the outcome standard_error_info object are highlighted.
|
|
Description:
|
The purpose of a shadow taper is to facilitate extraction from a mold rather than changing the general appearance of a model. Typically the angle supplied is very small.
|
|
|
This extension inserts a ruled face which tangentially meets the supplied face, and which covers the region in the shadow that is cast from a light source. The light source is directed from an infinite point and is at a given angle from the supplied draft direction.
|
|
|
This extension replaces regions of the face to be shadow tapered where the angle between the normal and the draft vector is greater than the complement of the given angle (i.e., greater than 90 - given angle) by ruled faces where the angle between the draft vector and the normal is exactly the complement of the given angle. Thus, the ruled faces meet the face to be tapered tangentially and are bounded by the intersections with either neighboring faces or the same face. The regions to be replaced are referred to as being "in shadow" with respect to the draft vector and the given angle.
|
|
|
The optional intersection box limits the size of intersections between surfaces which might otherwise be very long. It can not be used to choose faces. Its main purpose is to speed up complicated cases where the intersection curves might be very long, thus improving performance. The box must contain the final faces and if omitted defaults to the size box.
|
|
|
Topology Changes:
|
|
|
In addition to the following, refer to the topology changes listed for the Scheme extension,
lop:tweak-faces.
|
|
|
Almost every shadow taper will result in a topology change as the parts of the body that are "in shadow" are replaced by ruled faces.
|
|
|
Geometry Changes:
|
|
|
Refer to the geometry changes listed for the Scheme extension,
lop:tweak-faces.
|
|
|
Arguments:
|
|
|
face-list identifies faces of a body to be tapered.
|
|
|
direction specifies the direction vector pointing towards the light source.
|
|
|
angle specifies the draft angle of the taper operation in degrees.
|
|
|
box-h specifies one position defining a diagonal box for an intersection limit.
|
|
|
box-l specifies one position defining a diagonal box for an intersection limit.
|
|
|
acis-opts specifies options such as versioning and journaling.
|
|
Limitations:
|
In addition to the following, refer to the Limitations listed for the Scheme extension,
lop:tweak-faces.
|
|
|
|
No more than one face that is in the shadow can be deleted.
|
|
|
|
In general, there must be an intersection between the new face and either a face that is adjacent to the face to be tapered or a face that is "adjacent-but-one" to the face to be tapered.
|
|
Example:
|
; lop:shadow-taper-faces
|
|
; Create a solid block
|
|
(define block1
|
|
|
(solid:block (position -25 -25 -10)
|
|
|
(position 25 25 10)))
|
|
;; block1
|
|
; Create a solid cone
|
|
(define cone1
|
|
|
(solid:cone (position -20 0 10)
|
|
|
(position 20 0 10) 20 10))
|
|
;; cone1
|
|
; Unite the cone and block
|
|
(define unite (bool:unite block1 cone1))
|
|
;; unite
|
|
; OUTPUT Original
|
|
|
; Shadow taper a face on the body
|
|
(define taper (lop:shadow-taper-faces
|
|
|
(pick:face (ray (position 0 0 0)
|
|
|
(gvector 0 0 1))) (gvector 0 0 1) 20))
|
|
;; taper
|
|
; OUTPUT Result
|
|
|
|
|
Figure 2-10. lop:shadow-taper-faces
|
|
|
; Another example of lop:shadow-taper-faces
|
|
; this example illustrates this command on multiple
|
|
;
|
complex blends.
|
|
(part:clear)
|
|
;; #t
|
|
(define b1 (solid:block
|
|
|
(position -25 -50 -25) (position 25 50 25)))
|
|
;; b1
|
|
(define b2 (solid:block
|
|
|
(position -100 -100 0) (position 100 100 200)))
|
|
;; b2
|
|
(define transform (entity:transform b2
|
|
|
(transform:rotation
|
|
|
(position 0 0 0) (gvector 1 0 0) 45)))
|
|
;; transform
|
|
(define transformb2 (entity:transform b2
|
|
|
(transform:translation (gvector 0 0 25))))
|
|
;; transformb2
|
|
(define subtract (bool:subtract b1 b2))
|
|
;; subtract
|
|
(define edge1 (blend:const-rad-on-edge
|
|
|
(pick:edge (ray (position 0 0 0)
|
|
|
(gvector 0 0 1))) 30))
|
|
;; edge1
|
|
(define network
|
|
|
(blend:network (blend:get-network edge1)))
|
|
;; network
|
|
; OUTPUT First
|
|
|
(define edge2 (car (blend:const-rad-on-edge
|
|
|
(list (pick:edge (ray (position 25 20 -20)
|
|
|
(gvector 0 0 1))) (pick:edge (ray
|
|
|
(position 25 0 -20) (gvector 0 0 1)))
|
|
|
(pick:edge (ray (position 25 -20 -20)
|
|
|
(gvector 0 0 1)))) 5)))
|
|
;; edge2
|
|
(define network2 (blend:network
|
|
|
(blend:get-network edge2)))
|
|
;; network2
|
|
(option:set "annotation" #t)
|
|
;; #f
|
|
; OUTPUT Second
|
|
|
(option:set "unhook_annotations" #f)
|
|
;; #t
|
|
(lop:shadow-taper-faces (list (pick:face
|
|
|
(ray (position 24 -20 -20) (gvector 0 0 1)))
|
|
|
(pick:face (ray (position 24 0 -20)
|
|
|
(gvector 0 0 1))) (pick:face (ray
|
|
|
(position 24 20 -20) (gvector 0 0 1))))
|
|
|
(gvector 0 0 1) 30)
|
|
;; #[entity 5 1]
|
|
; OUTPUT Third
|
|
|
; Render the image
|
|
(render)
|
|
;; ()
|
|
; OUTPUT Rendered
|
|
|
|
|
|
|
|
Figure 2-11. lop:shadow-taper-faces
|