SchemeDT:Sweep Options
From DocR23
Contents |
Action
A Sweep_Options is a Scheme data type that holds options for the sweep Scheme extension. This data type is created by the sweep:options Scheme extension.
Not all of the options appear in the list. They only appear if they are explicitly specified in the sweep:options Scheme extension.
Some of the options are mutually exclusive. The option "draft_angle" is mutually exclusive with "draft_law", which is mutually exclusive with "start_draft_dist" / "end_draft_dist" Internally, all of these options are converted to the equivalent law.
The option "twist_angle" is mutually exclusive with "twist_law". Internally, these options are converted to the equivalent law. Refer to the sweep:options Scheme extension or the sweep_options class for more details.
Derivation
Sweep_Options:scheme-object
C++
External Rep
#[Sweep_Options "solid" %b {"draft_angle" %lf | "draft_law" %s | "draft_start_distance" %lf "draft_end_distance" %lf"} "gap_type" %s {"twist_angle" | "twist_law"%s} "to_face" %x "rail_law" %s "scale_law" %s"]
Examples
; Sweep_Options (data type) ; Define the sweep options to use. ; These are the default options. (define my_sweep_default (sweep:options)) (print my_sweep_default) ;;#[Sweep_Options: ;; "close_to_axis" #f ;; "draft_angle" 0.000000 ;; "gap_type" 2 ;; "portion" "entire_path" ;; "self_int_test" 1 ;; "simplify" #t ;; "solid" #t ;; "sweep_angle" 360.000000 ;; "twist_angle" 0.000000 ;;] ; Define new sweep options where all values are default except the draft_law. (define my_sweep_s1 (sweep:options "draft_law" "sin(x)")) (print my_sweep_s1) ;;#[Sweep_Options: ;; "close_to_axis" #f ;; "draft_law" SIN(X) ;; "gap_type" 2 ;; "portion" "entire_path" ;; "self_int_test" 1 ;; "simplify" #t ;; "solid" #t ;; "sweep_angle" 360.000000 ;; "twist_angle" 0.000000 ;;] ; Define another set of sweep options that is almost the same as my_sweep_s1 ; except for a minor change to the gap_type to be "natural". (define my_sweep_s2 (sweep:options "gap_type" "n" my_sweep_s1)) (print my_sweep_s2) ;;#[Sweep_Options: ;; "close_to_axis" #f ;; "draft_law" SIN(X) ;; "gap_type" 2 ;; "portion" "entire_path" ;; "self_int_test" 1 ;; "simplify" #t ;; "solid" #t ;; "sweep_angle" 360.000000 ;; "twist_angle" 0.000000 ;;]
; Example of sweep dependent on sweep option (part:clear) ; Create a sweep path from points (define my_plist (list (position 0 0 0) (position 20 0 0) (position 20 20 0) (position 20 20 20))) (define my_start (gvector 1 0 0)) (define my_end (gvector 0 0 10)) (define my_path (edge:spline my_plist my_start my_end)) ; Create profile (define my_edge1 (edge:linear (position 0 3 3) (position 0 3 -3))) (define my_edge2 (edge:linear (position 0 3 -3) (position 0 -3 -3))) (define my_edge3 (edge:linear (position 0 -3 -3) (position 0 -3 3))) (define my_edge4 (edge:linear (position 0 -3 3) (position 0 3 3))) (define my_profile (wire-body (list my_edge1 my_edge2 my_edge3 my_edge4))) ; Create rail law (define my_law (law "cur(edge1)" my_path)) (define my_rail (law "minrot(law1,vec(0,-1,0))" my_law)) ; Perform sweep with created profile, path and supply the rail-law through options (define my_sweep (sweep:law my_profile my_path (sweep:options "rail_law" my_rail)))