Action:
|
Creates a sheet body that fits a surface through a sequence of coedges, while providing start and end tangent control.
|
|
Prototype:
|
outcome api_loft_coedges (
|
|
|
int n_set,
|
|
// number of
|
|
|
|
|
|
// connected coedge
|
|
|
|
|
|
// lists
|
|
|
Loft_Connected_Coedge_List*
|
// list of connected
|
|
|
|
set_ce_list,
|
|
// coedge lists
|
|
|
BODY*& sheet_body,
|
|
// output sheet body
|
|
|
skin_options* opts,
|
|
// skinning options
|
|
|
AcisOptions* ao = NULL
|
// ACIS options such
|
|
|
|
|
// as version and journal
|
|
|
);
|
|
|
outcome api_loft_coedges (
|
|
|
int n_set,
|
|
// number of
|
|
|
|
|
|
// connected coedge
|
|
|
|
|
|
// lists
|
|
|
Loft_Connected_Coedge_List*
|
// list of connected
|
|
|
|
set_ce_list,
|
|
// coedge lists
|
|
|
int num_of_guides
|
|
// number of guides
|
|
|
EDGE*guides[]
|
|
// guide curves
|
|
|
BODY*& sheet_body,
|
|
// output sheet body
|
|
|
skin_options* opts,
|
|
// skinning options
|
|
|
AcisOptions* ao = NULL
|
// ACIS options such
|
|
|
|
|
// as version and journal
|
|
|
);
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "kernel/kernapi/api/api.hxx"
|
|
#include "kernel/kerndata/top/body.hxx"
|
|
#include "skin/kernapi/api/skinapi.hxx"
|
|
#include "skin/sg_husk/skin/skin_opts.hxx"
|
|
#include "baseutil/logical.h"
|
|
#include "kernel/kernapi/api/acis_options.hxx"
|
|
Description:
|
The newly created shell or solid body interpolates
n cross sections defined by a list of coedges. The
n sections are given as an array of cross section definitions (Loft_Connected_Coedge_List). Each array element defines a list of coedges whose edges define the cross section. If the coedges exist in a
FACE, the surface tangents at the boundary are associated with the sections. The default direction of tangents is outwards from the face.
|
|
|
The
api_loft_coedges takes a data structure called
Loft_Connected_Coedge_List. This is composed of the number of coedges in the cross section, a pointer to the first coedge in a list of coedges, the cross section orientation, the take-off vector weight factor, and an array of laws. Every cross section used in lofting has to have this data structure. At the very minimum, two
Loft_Connected_Coedge_List structures need to be created.
|
|
|
In the case that a closed solid body is required, at least three distinct coedge lists must be provided. If the first and last coedge lists are identical, a closed solid loft body is automatically constructed. The end tangency will depend on the laws specified at the first and last profiles. If duplicate copies of the internal coedge lists are sent to
api_loft_coedges, the copies are ignored while producing the loft.
|
|
|
If the user provides a set of closed profiles, the face normals of the loft body point outside, away from the body material. When the user provides a set of open profiles, the face normals of the loft face are oriented along the surface normals, and no attempt is made to change the face normal orientation.
|
|
|
Loft_Connected_Coedge_List is defined in
sg_husk/skin/skin.hxx:
|
|
|
struct Loft_Connected_Coedge_List {
|
|
|
int n_list;
|
|
|
|
// number of coedges
|
|
|
COEDGE **coedge_list;
|
// list of coedges
|
|
|
REVBIT coedge_orient;
|
// alignment of coedge
|
|
|
double cross_tg_attr;
|
// take-off vector factor
|
|
|
law **law_list;
|
|
|
// list of tangency laws
|
|
};
|
|
|
The default orientation of the
Loft_Connected_Coedge_List is the orientation of the first coedge. However, it can be reversed using
coedge_orient, the third argument of the data structure. When the coedges in the list are associated with a surface, the cross section orientation uses
REVBIT to set the direction "out of" or "into" the starting surface. The expression "out of" means that the lofted surface is going
out of the given ending surface, while "into" means that the lofted surface is going
into the ending surface. When lofting between two surfaces, the starting surface needs to have its
REVBIT set to 0 (for "out of", the default) and the ending surface needs to have its
REVBIT set to 1 (for "into"). When lofting between multiple surfaces, the first surface has its
REVBIT set for 0, while all others are set for 1. When lofting between a surface and an edge,
REVBIT for both can be 0.
|
|
|
The take-off vector is a tangent vector going out of a given surface and into the lofted surface. The lofted surface is always tangent to the surface bounded by the coedges. The vectors denoting the tangency of the section are scaled to a maximum value of 1.0. The weight factor
cross_tg_attr, which is the fourth argument of the
Loft_Connected_Coedge_List, is used to scale the magnitude. Its default value is 1.0. A value of zero implies suppression of tangency and negative value results in its reversal.
|
|
|
The weight factor argument in the
Loft_Connected_Coedge_List for each cross section is used by the take-off vector. Small values for the weighting of the take-off vector mean that the transition from the tangent to the lofted surface happen abruptly. Large values for the weighting of the take-off vector mean that the transition from the tangent to the lofted surface happen more gradually. Extremely high weight values could result in excessive whipping in the lofted surface, if not a self-intersecting surface.
|
|
|
The ending point of any coedge
Loft_Connected_Coedge_List should be the starting point of the next coedge in the list, first and last coedges excepted. In other words, the coedges are ordered in the list as they appear next to each other in model space. There cannot be any gaps between adjacent coedges.
|
|
|
The last argument in
Loft_Connected_Coedge_List is an array of law pointers. Each coedge in the coedge list can define a law as a constraint which describes the tangency of the edge. If laws aren't used to control the tangency, the pointer should be
NULL.
|
|
|
Once the cross section data structures have been established, the
api_loft_coedges function can be called. However, if needed, guide curves can be passed to the api. Lofting with guides displays the following behavior.
|
|
|
Lofting with guide curves accepts an array of guides in addition to the cross section profiles. The guides are accepted as
EDGEs only, never as wire bodies. The curve underlying the guide must be c1 continuous and non-looping. In addition, the guide must touch each wire profile within
SPAresabs and start and stop exactly on the first and last profiles. Direction is not important. The guides can intersect the section profiles on or off vertices. If the guide does not lie on any vertices no surface edge is created. If the guide intersects the first profile off a vertex but intersects any other profile on a vertex, a surface edge is made. In addition to accepting guides the overloaded API supporting guide curves takes the logical flag "VirtualGuides". This flag toggles the guides from being local surface control to global surface control. For example, in the case of local surface control, the guide curve only affects the surface created from the edges of the wire that the guide intersects. In the case of "VirtualGuides" being
TRUE, the guide affects all the surfaces made from the wire body cross sections.
|
|
|
Lofting with guide curves does not support degenerate wires because tangent constraints cannot be placed on degenerate profiles. To use guides on degenerate profiles, please see
api_skin_wires.
|
|
|
The api_loft_coedges function accepts eleven special options:
|
|
|
-
|
arc_length_option can be used to choose either arc length or isoparametric parameterization. If the series of cross sections are equispaced, the isoparametric option may be used. If the sections do not have the same number of coedges, the arc length option produces a better result. With arc length parameterization, the proportional lengths of each coedge on each section are mapped to the other section. These markings then serve as boundaries for additional coedges that are created on each section. The default is
FALSE.
|
|
-
|
twist_option may be used to minimize the twist of the surface produced. The default is
FALSE.
|
|
-
|
align_direction_option can align the direction of the cross section curves such that they are in the same direction as the first curve. If the sections are not oriented in the same direction, the alignment option should be used to avoid producing a twisted, self intersecting body. The default is
TRUE.
|
|
-
|
perpendicular_option specifies the direction of the take-off vector, either perpendicular to the coedge or in the skin direction. The default is
FALSE (i.e., in the skin direction), because a perpendicular take-off vector can cause self-intersections to the surface.
|
|
-
|
simplify_option simplifies the surface to a conical surface, if applicable. If all of the cross sections lie on a conical surface (plane, cylinder, cone, sphere, or torus), the conical surface is created instead. The
SPAresabs variable is used to determine whether or not the cross section lies on the conical surface. The default is
FALSE.
|
|
-
|
closed_option (closed = 1/TRUE) may be used when the user needs to construct a body closed in v. A solid body will be constructed only when all the wires supplied are closed; otherwise this option will be ignored. If the user provides a value closed = 2, the loft body will be periodic in v, instead of being closed in v. The default is
FALSE i.e. closed = 0.
|
|
-
|
solid_option may be used when a solid 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 default is
FALSE.
|
|
-
|
virtual guide option my be used in order to have the user defined guides effect the body in a global nature. The default is FALSE.
|
|
-
|
When the
merge_wirecoedges 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 because it reduces the coedge/edge count and the number of surfaces and eliminates near tangent edges. The default is
TRUE.
|
|
-
|
match_vertices option 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. This option is forced to
TRUE if the coedge numbers of the profiles are not equal. Its default is
TRUE.
|
|
-
|
guidePreference option specifies the surface constraint that will be used if the guides and tangent vectors do not match. The two possible values are
constrain_to_guide and
constrain_to_tangent. The default is
constrain_to_guide.
|
|
Limitations:
|
End capping (for creation of open solid bodies) is supported only for planar end profiles. If the end capping operation fails then the sheet body constructed is returned. When end capping for constructing solid lofts, it is possible to produce self intersecting faces and therefore invalid bodies. Self intersection checks are not being done with this function.
|
|
Library:
|
skin
|
|
Filename:
|
skin/skin/kernapi/api/skinapi.hxx
|
|
Effect:
|
Changes model
|