Skinning and Lofting Options
From DocR21
The API for Skinning and Lofting takes Skinning and Lofting Options to control surface parameterization, wire twist, wire direction, simplification, creation of a solid or closed body and various other parameters. Although different types of skinning and lofting accept different options, all options maintain the same principle and purpose across the functional variations.
arc_length (false)
The arc_length option is used to choose arc length or isoparametric parameterization of the skinned or lofted surfaces. With isoparametric parameterization the surface parameter in the v direction follows the cross section curves. With arc length parameterization the surface parameter follows lines of constant length. The default is isoparametric parameterization. This option is ignored when skinning with guide curves.
; Turn on u_param lines to see different parameterization. (part:clear) (option:set 'u_param 7) (option:set 'v_param 0) (define wire_1 (wire-body (list (edge:linear (position 0 0 0) (position 50 0 0))(edge:linear (position 50 0 0) (position 50 50 0)) (edge:linear (position 50 50 0) (position 0 50 0))(edge:linear (position 0 50 0) (position 0 0 0))))) (define wire_2 (wire-body (list (edge:linear (position 0 0 60) (position 50 0 40))(edge:linear (position 50 0 40) (position 50 50 40))(edge:linear (position 50 50 40) (position 0 50 60))(edge:linear (position 0 50 60) (position 0 0 60))))) (define wire_3 (wire-body (list (edge:linear (position 0 0 100) (position 50 0 100))(edge:linear (position 50 0 100) (position 50 50 100))(edge:linear (position 50 50 100) (position 0 50 100))(edge:linear (position 0 50 100) (position 0 0 100))))) (zoom-all) ; --- Arc length (define arc_body (sheet:skin-wires (list wire_1 wire_2 wire_3) (skin:options "arc_length" #t "simplify" #f "solid" #f))) (define move1 (entity:move arc_body 100 0 0)) (entity:set-color (list wire_1 wire_2 wire_3) 0) ; --- Iso (define iso_body (sheet:skin-wires (list wire_1 wire_2 wire_3) (skin:options "arc_length" #f "simplify" #f "solid" #f))) (define move2 (entity:move iso_body -100 0 0)) (iso) (zoom-all)
arc_length_u (false)
In the case of skinning with guide curves with arc length parameterization, the guide curve is arc length parameterized: however, the surface is still isoparametric. The arc_length_u option reparameterizes curves of the skinning or lofting profiles to arc length. The default value is FALSE.
no_twist (true)
The no_twist option may be used to minimize the twist of the surface produced. Twist minimization aligns closed curves such that the start of the second curve is aligned to the start of the first curve. Even if a body's shape is unaffected by twisting, a surface with a twist could produce unexpected results when faceting and rendering. The following two figures illustrate twist minimization.
(define loop1 (wire-body (list (edge:circular (position 0 0 5) 10) ))) (define loop2 (wire-body (list (edge:linear (position -10 -10 -5) (position -10 10 -5)) (edge:linear (position -10 10 -5) (position 10 10 -5)) (edge:linear (position 10 10 -5) (position 10 -10 -5)) (edge:linear (position 10 -10 -5) (position -10 -10 -5))))) (define opts (skin:options "no_twist" #f "self_int_test" 0)) (define skin (sheet:skin-wires (list loop1 loop2) opts)) (define skin2 (sheet:2d skin)) ; OUTPUT Twist (roll -2) (define opts (skin:options "no_twist" #t "self_int_test" 1)) (define skin (sheet:skin-wires (list loop1 loop2) opts)) (define skin2 (sheet:2d skin)) ; OUTPUT No Twist
no_new_twist_vertices (false)
The algorithm that minimizes the surface twist may add vertices to some of the profiles if none of the existing vertices match well. The no_new_twist_vertices option allows you to force the algorithm to choose matching vertices from the existing vertices. The default value is FALSE.
align (true)
This option is used to align the direction of the cross section curves such that the normal of the first profile points towards the second profile. All other profiles are aligned to follow the first and second. If the sections are not oriented in the same direction, the align option should be used to avoid producing a twisted, self-intersecting body. Refer to the following figure for an example of alignment of open coedges. Closed loops of wires can also be aligned. The default is aligned.
perpendicular (false)
The take-off vector is a tangent vector going out of the starting edge or surface and into the skinned or lofted surface. The perpendicular option (for lofting only) is used to specify the direction of the take-off vector, perpendicular to the coedge or in the loft direction. (This removes any restriction that the take-off vector for the loft has to be determined by the cross-product of the coedge tangent vector and the surface normal times the tangent factor.) The default is in the loft direction, because a perpendicular take-off vector can cause self-intersections to the surface.
(define wire_1 (wire-body (list (edge:linear (position 0 0 0) (position 50 0 0)) (edge:linear (position 50 0 0) (position 50 50 0)) (edge:linear (position 50 50 0) (position 0 50 0)) (edge:linear (position 0 50 0) (position 0 0 0))))) (define wire_2 (wire-body (list (edge:linear (position 100 0 0) (position 150 0 0)) (edge:linear (position 150 0 0) (position 150 50 0)) (edge:linear (position 150 50 0) (position 100 50 0)) (edge:circular-3pt (position 100 50 0) (position 90 25 0) (position 100 0 0))))) (zoom-all) (sheet:planar-wire wire_1) (sheet:planar-wire wire_2) (define coedge1 (list-ref (entity:coedges wire_1) 1)) (define coedge2 (list-ref (entity:coedges wire_2) 3)) (define loft_wire1 (section coedge1 #f 1)) (define loft_wire2 (section coedge2 #t 3)) (define Sect (list loft_wire1 loft_wire2)) (define opts0 (skin:options "perpendicular" #t)) (define body0 (sheet:loft-wires Sect opts0)) (sheet:2d body0) (roll -2) (define opts1 (skin:options "perpendicular" #f)) (define body1 (sheet:loft-wires Sect opts1)) (sheet:2d body1)
simplify (true)
This simplify option simplifies the skin surface to an analytic surface, if applicable. If all of the cross sections lie on an analytic surface (plane, cylinder, cone, sphere, or torus), the analytic surface is created instead. The SPAresabs tolerance variable is used to determine whether or not the cross section lies on an analytic surface.
closed (false)
This option may be used to construct a solid body that is closed in the v parameter direction (for example, a torus). A solid body will be constructed only when all the wires supplied are closed. At least three profiles must be provided to create a closed body. The default is FALSE.
If you provide a set of closed profiles, the face normals of the skin or loft body point outside, away from the body material. If you provide a set of open profiles, the face normals of the skin or loft face are oriented along the surface normals; no attempt is made to change the face normal orientation.
(define loop1 (wire-body (list (edge:linear (position -20 0 0)(position -20 0 5)) (edge:linear (position -20 0 5)(position -15 0 5)) (edge:linear (position -15 0 5)(position -15 0 0)) (edge:linear (position -15 0 0)(position -20 0 0))))) (define loop2 (wire-body (list (edge:linear (position 0 -20 0)(position 0 -20 5)) (edge:linear (position 0 -20 5)(position 0 -15 5)) (edge:linear (position 0 -15 5)(position 0 -15 0)) (edge:linear (position 0 -15 0)(position 0 -20 0))))) (define loop3 (wire-body (list (edge:linear (position 20 0 0)(position 17.5 0 5)) (edge:linear (position 17.5 0 5)(position 15 0 0)) (edge:linear (position 15 0 0)(position 20 0 0))))) (define loop4 (wire-body (list (edge:linear (position 0 20 0)(position 0 17.5 5)) (edge:linear (position 0 17.5 5)(position 0 15 0)) (edge:linear (position 0 15 0)(position 0 20 0))))) ; OUTPUT Original (iso) (zoom-all) (define opts1 (skin:options "closed" #t)) (define skin1 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts1)) (roll -1) (define opts2 (skin:options "closed" #f)) (define skin2 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts2))
solid (true)
The solid option may be used when a solid skin or loft must be constructed but a closed body is not desired. When a closed body is not desired, the end wires are capped with planar faces. The end face normals are oriented away from (outside) the resulting body. The default is a solid body.
(define loop1 (wire-body (list (edge:linear (position 20 0 0)(position 17.5 0 5)) (edge:linear (position 17.5 0 5)(position 15 0 0)) (edge:linear (position 15 0 0)(position 20 0 0))))) (define loop2 (wire-body (list (edge:linear (position 0 20 0)(position 0 17.5 5)) (edge:linear (position 0 17.5 5)(position 0 15 0)) (edge:linear (position 0 15 0)(position 0 20 0))))) (define loop3 (wire-body (list (edge:linear (position -20 0 0)(position -20 0 5)) (edge:linear (position -20 0 5)(position -15 0 5)) (edge:linear (position -15 0 5)(position -15 0 0)) (edge:linear (position -15 0 0)(position -20 0 0))))) (define loop4 (wire-body (list (edge:linear (position 0 -20 0)(position 0 -20 5)) (edge:linear (position 0 -20 5)(position 0 -15 5)) (edge:linear (position 0 -15 5)(position 0 -15 0)) (edge:linear (position 0 -15 0)(position 0 -20 0))))) ; OUTPUT Original (iso) (zoom-all) (define opts1 (skin:options "closed" #f "solid" #t)) (define skin1 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts1)) (roll -1) (define opts2 (skin:options "closed" #f "solid" #f)) (define skin2 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts2))
periodic (false)
This option allows the construction of loft bodies that are periodic in v, that is, bodies that close back on themselves smoothly (continuously) at the start and end profiles. This option is activated in the skinning APIs by giving the closed option a value of 2. In the Scheme AIDE this is achieved by setting the periodic flag to TRUE. As with the closed option, at least three profiles must be supplied to create a periodic loft body. The default is FALSE.
(define loop1 (wire-body (list (edge:linear (position 20 0 0)(position 17.5 0 5)) (edge:linear (position 17.5 0 5)(position 15 0 0)) (edge:linear (position 15 0 0)(position 20 0 0))))) (define loop2 (wire-body (list (edge:linear (position 0 20 0)(position 0 17.5 5)) (edge:linear (position 0 17.5 5)(position 0 15 0)) (edge:linear (position 0 15 0)(position 0 20 0))))) (define loop3 (wire-body (list (edge:linear (position -20 0 0)(position -20 0 5)) (edge:linear (position -20 0 5)(position -15 0 5)) (edge:linear (position -15 0 5)(position -15 0 0)) (edge:linear (position -15 0 0)(position -20 0 0))))) (define loop4 (wire-body (list (edge:linear (position 0 -20 0)(position 0 -20 5)) (edge:linear (position 0 -20 5)(position 0 -15 5)) (edge:linear (position 0 -15 5)(position 0 -15 0)) (edge:linear (position 0 -15 0)(position 0 -20 0))))) ; OUTPUT Original (iso) (zoom-all) (define opts1 (skin:options "closed" #t "periodic" #t)) (define skin1 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts1)) (roll -1) (define opts2 (skin:options "closed" #t "periodic" #f)) (define skin2 (sheet:skin-wires (list loop1 loop2 loop3 loop4) opts2))
virtualGuides (false)
This option may be used in order to have the user-defined guides affect the body in a global nature. The default value is FALSE. Refer to Skinning with Virtual Guide Curves.
merge_wirecoedges (true)
When this option is set to TRUE, the G1 vertices of the skinning and lofting wire profiles are removed by merging adjacent coedges/edges. This improves operations such as blending and shelling as it reduces the coedge/edge count and the number of surfaces, and eliminates near tangent edges. The default value is TRUE.
estimate_loft_tanfacs (false)
When this option is on the weight factor for the tangency conditions of the loft will be determined such that it minimizes the average radius of curvature of the lofting surfaces. The resulting bodies should support shelling to greater thickness and also blending of their edges to larger blend radii. The default value is FALSE.
match_vertices (true)
The match_vertices option (when FALSE) suppresses the vertex matching algorithm which ensures that all profiles consist of the same number of coedges. A heuristic approach is used to determine which vertex pairs are good matches. Profile coedges are then split where additional vertices are needed. If you have an equal number of edges per skinning profile and do not wish to have any change in topology, then set this option to FALSE. However, this option will be forced to TRUE if the coedge numbers of the profiles are not equal. Its default is TRUE.
Note: This option replaces the global options match_corners and align_corners in versions 7.0 and later.
guide_curve_preference (FOLLOW_GUIDE_CONSTRAINT)
The guide_curve_preference option is an enumerated type with two possible values, FOLLOW_GUIDE_CONSTRAINT and FOLLOW_TANGENT_CONSTRAINT. This option is used to specify how an over-constrained guide is resolved. If the type FOLLOW_GUIDE_CONSTRAINT is set, then the resulting lofting surface will always stay with the defining guide curve. If the FOLLOW_TANGENT_CONSTRAINT is specified, then the lofting surface will always follow the tangent constraint. Default is FOLLOW_GUIDE_CONSTRAINT.
gap_type (SKIN_GAP_EXTENDED)
The gap_type option specifies how to fill a gap that may occur between two lateral faces in a lofting or skinning with draft operation. The type can be SKIN_GAP_EXTENDED ("extended"), SKIN_GAP_CHAMFERED ("chamfered") or SKIN_GAP_ROUNDED ("rounded").
- Extended Gap: The lateral surfaces extend naturally until they intersect and produce a lateral edge. This is the recommended and default behavior.
- Chamfered Gap: Skinning constructs a linear surface that connects the two lateral faces. This is a ruled type surface.
- Rounded Gap: Skinning constructs a surface that is tangential to the two lateral faces.
self_int_test (1)
This option checks for a self intersecting skin surfaces. Commonly self-intersecting skin surfaces can be made based on poor tangent factor magnitudes, poor profiles, or an incorrect usage of the perpendicular option. If set to 0, the check will not be made and a body will be built: however, later modeling problems may appear. If 2 is specified, the check will be performed, but it will notify with a warning. The default value is 1, which means an error will be thrown.
allow_same_uv (false)
This option allows surfaces with the same u and v direction to be created. If the option is set to TRUE and a surface with the same u and v direction is created, a warning will be thrown. If set to FALSE, an error will be thrown.
Note: If this option is set to TRUE and a surface with the same u and v direction is created, later modeling problems may appear.
smooth_g0_vertices (float)
When profiles have G0 continuity at vertices, this option may be used to force a G1 continuity at those vertices. The option sets a maximum smooth angle value, in degrees, between two tangent vectors from two connected spline curve at a G0 vertex. If the angle is less than or equal to the specified value, the two spline curves will be modified to have a G1 continuity at the vertex. The default value for the option is 0, which means no smoothing operation will be applied.
postprocess_stitch (false)
This option stitches the resulting lofting body to the original bodies from which its coedge definition came. This option only works with api_loft_coedges (lofting) and not with any skinning operation (api_skin_wires). It is identical in nature to the stitching operation performed in api_loft_faces. The default is FALSE.
