blend:make-cross-curve
List of: Scheme Extensions
Subjects: Blending, Modifying Models
Contents: Blending

Action: Creates a "rib" curve, running from one base entity to the other, at a location along a blend determined by the v-parameter.

Filename: blnd/blnd_scm/blnd_scm.cxx

APIs: api_make_blend_cross_curve

Syntax: (blend:make-cross-curve edge real [acis-opts])

Arg Types: edge edge

real real

acis-opts acis-options

Returns: entity

Description: Gets an edge with an attached blend attribute and the value of a v-parameter along the blend. Given an edge with an attached blend attribute (currently, only ATTRIB_VAR_BLEND or ATTRIB_CONST_ROUND) and a v-parameter along the blend, this extension creates a "rib" curve, running from one base entity to the other, at a location along the blend determined by the v-parameter. (The v-parameter runs along the blend, and the u-parameter runs from one base surface to the other.) The v-parameter of the blend is the same as that of its defining curve, which is generally the curve of the edge being blended.


Sometimes the blend cannot evaluate a cross curve at the given parameter, for example, if the blend radius is too big.


The returned entity is a "rib" curve.


edge is an edge with an attached blend attribute and the value of a v-parameter along the blend.


real is the v-parameter - value of the parameter along the blend.


acis-opts contains optional parameters that are specific to the component and general ACIS options such as the journal and version information. The option argument (must be the last argument) is a class derived from acis-opts.

Limitations: Currently, only ATTRIB_VAR_BLEND or ATTRIB_CONST_ROUND

Example: ; blend:make-cross-curve

; Set up views.

(part:clear)

;; #t

(define view (cond ((>= 0 (length (part:views)))


(define dlv (view:dl 0 0 600 600)))))

;; view

(define iso (map iso (env:views)))

;; iso

; Define geometry to illustrate command.

; Define cylinder length H, radius r, wing span

; S, and surface curvature R.

(define H 30.0)

;; H

(define r 4.0)

;; r

(define S 40.0)

;; S

(define R 8.0)

;; R

; Create a cylinder and then a wing.

(define cyl (solid:cylinder (position (/ H -2) 0 0)


(position (/ H 2) 0 0) r))

;; cyl

(define wing (solid:cylinder (position 0 0 0)


(position 0 (- 0 S) 0) R))

;; wing

; Create a tool to cut the wing.

(define tool (solid:block (position (/ S -2) (* -2 S)


(/ S -2)) (position (/ S 2) (* 2 S) (/ S 2))))

;; tool

; Slightly rotate and change the angle of the tool.

(define transform1 (entity:transform tool


(transform:rotation (position 0 0 0)


(gvector 1 0 0) -4)))

;; transform1

; Transform the tool.

(define transform2 (entity:transform tool


(transform:translation


(gvector 0 0 (+ (/ S -2) r)))))

;; transform2

(define subtract (solid:subtract wing tool))

;; subtract

; Round out the wing's leading edge.

(option:set "raysize" (/ R 4))

;; 1

(define lead_edge (pick:edge (ray (position (/ R -2)


(/ S -2) R) (gvector 0 0 -1))))

;; lead_edge

; Attach the variable round blend attributes to edge.

; Blending preview visible in OpenGL only.

(define blend1 (blend:var-round lead_edge 1.0 0.25))

;; blend1

; Fix the blend network.

(define blend_fix (blend:fix lead_edge))

;; blend_fix

; Move wing into proper place.

(define move_wing (entity:transform wing


(transform:translation


(gvector 0 0 (- (* 0.75 r) R)))))

;; move_wing

; Unite the cylinder and the wing.

(define unite (solid:unite cyl wing))

;; unite

; Apply the transforms to the underlying geometry.

(define fix (entity:fix-transform cyl))

;; fix

; Apply the blend CONST_RADIUS attribute to all edges

; of the wing-cylinder intersection.

(option:set "raysize" (/ r 2))

;; 2

; Select the edge(s) to be blended.

(define round_edge (pick:edge (ray (position 0 0 0)


(gvector 0 -1 1))))

;; round_edge

; Find all the edges that join smoothly.

(define smooth-edges


(blend:get-smooth-edges round_edge))

;; smooth-edges

; Attach a constant radius blend attribute to each

; edge in the list.

(define blend2


(blend:const-rad-on-edge smooth-edges 4.5))

;; blend2

; Now, pick the front rounded edge.

(define currEdge (list-ref smooth-edges 1))

;; currEdge

; OUTPUT Original


; Create a cross curve.

(define cross-curve


(blend:make-cross-curve currEdge 1.0))

;; cross-curve

; Create an edge from the curve.

(define new_edge (edge:from-curve cross-curve))

;; new_edge

; Render the image.

(render)

;; ()

; OUTPUT Rendered





Figure 2-8. blend:make-cross-curve
PDF/BLND/02SC.PDF
HTM/DATA/BLND/BLND/02SC/0012.HTM