sweep:options
List of: Scheme Extensions
Subjects: Laws, Sweeping
Contents: Sweeping

Action: Sets the options in the data structure to be used by sweep:law.

Filename: swp/swp_scm/swp_scm.cxx

Syntax: (sweep:options "name-of-option"


{value | location direction})

Arg Types: "name-of-option" string

value string | law | real | gvector |


entity | boolean | integer

location position

direction gvector

Returns: Sweep_Options

Description: The sweep:options Scheme extension defines elements in the Sweep_Options data structure that are later used for the sweep:law operation.


name-of-option is a string placed within quotation marks. If value is a real, it does not require delimiters. If value is a string representing a law, it should be enclosed in quotation marks. If value is a law, only the variable name for the law is required. Multiple pairs of name-of-option and value can be specified simultaneously.


(sweep:options "draft_angle" 5 "solid" #f)


The options are explained in detail in the discussion topic Options for a Law Sweep and include:


bool_type

close_to_axis

cut_end_off

draft_angle

draft_hole

draft_law

draft_repair

end_draft_dist

gap_type

keep_branches

keep_law

keep_start_face

miter

portion

rail_laws

rigid

solid

steps

sweep_angle

sweep_to_body

to_face

twist_angle

twist_law

two_sided


See also sweep:test for a demonstration of all sweep options.


The sweep option draft_angle is a real number that represents the angle with which the swept profile is to draft while sweeping. Drafting has two mutually exclusive options which are draft_angle and draft_law. The default for draft_angle is 0. One application of drafting is for molded items. As the profile is swept, the ending profile has been offset by an equal distance, which helps with the removal of the item from a mold. Extreme draft angles or draft laws can result in errors due to self-intersecting bodies, incomplete lateral faces (likely at corners), and/or unsupported topologies.


The sweep option end_draft_dist defines where to stop the end of the draft.


Twisting has two mutually exclusive options: twist_angle and twist_law. Only one can be set by the sweep:options extension. When one is set, the other is cleared out. The default is twist_angle set to 0. Moreover, if the rail_law array was set up using law:make-rails and it included a twist law, then rail_law would be mutually exclusive with the twist_law option (i.e., don't use the twist law more than once).

Limitations: The two twist options are mutually exclusive. When the rail law array includes a twist law, do not apply another twist law as part of a sweep option. Some options only appear if they are explicitly specified out or are non-selected and mutually exclusive.

Example: ; sweep:options

; Define the sweep options to use.

; These are the default options.

(define sweep1 (sweep:options))

;; sweep1

; Define new sweep options where all values are

; default except the draft_law.

(define s1 (sweep:options


"draft_law" "sin(x)"))

;; s1

; Define another set of sweep options that is almost

; the same as s1 except for a minor change

; to the gap-type

(define s2 (sweep:options


"gap_type" "n" "draft_law" "sin(x)"))

;; s2


; Create a sweep path from points

(define plist1 (list (position 0 0 0)


(position 20 0 0) (position 20 20 0)


(position 20 20 20)))

;; plist1

(define start1 (gvector 1 0 0))

;; start1

(define end1 (gvector 0 0 10))

;; end1

(define path1 (edge:spline plist1


start1 end1))

;; path1

(define law1 (law "cur (edge1)" path1))

;; law1

(define rail1 (law "minrot (law1,vec (0,-1,0))"


law1))

;; rail1

(define edgelist1 (list (edge:linear (position 0 3 3)


(position 0 3 -3)) (edge:linear (position 0 3 -3)


(position 0 -3 -3)) (edge:linear


(position 0 -3 -3) (position 0 -3 3))


(edge:linear (position 0 -3 3)


(position 0 3 3))))

;; edgelist1

(define profile1 (wire-body edgelist1))

;; profile1

(define sweep1 (sweep:law profile1 path1


(sweep:options "rail_law" rail1)))

;; sweep1
PDF/SWP/02SC.PDF
HTM/DATA/SWP/SWP/02SC/0006.HTM