⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acis_tutorials_(geometry).htm

📁 acis说明文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
</p><a name="Pcurve-related_Functions"></a><h3> <span class="mw-headline"> Pcurve-related Functions </span></h3><p>Some of the most commonly used functions to construct, destruct, and query pcurves are enumerated below.  </p><p>To create and remove pcurves:<br/></p><pre>sg_add_pcurve_to_coedge( )<br/>sg_add_pcurves_to_entity( )<br/>sg_rm_pcurve_from_entity( )</pre><blockquote class="templatequote"><div><p><i><b>Note:</b>  Removing necessary pcurves with sg_rm_pcurve_from_entity( ) can corrupt your model.  Use it with extreme caution.</i></p></div></blockquote> <p>To obtain the PCURVE pointer from a COEDGE:<br/></p><pre>PCURVE* COEDGE::geometry( ) const</pre><p>To obtain a copy of a private pcurve from a PCURVE, or to construct a pcurve from a PCURVE without a private pcurve:<br/></p><pre>pcurve PCURVE::equation( ) const</pre><blockquote class="templatequote"><div><p><i><b>Note:</b>  PCURVE::equation( ) returns a pcurve by value, not by reference.</i></p></div></blockquote> <p>To obtain parameter space boxes:<br/></p><pre>SPApar_box pcurve::bound( ) const<br/>sg_get_face_par_box( ) </pre><p>We should mention that adding the parameter space boxes of all the pcurves on a FACE that lies on a periodic surface or a surface with singularities may not give you the the same result as calling sg_get_face_par_box( ).  You must consider periodicity and singularities when computing parameter space boxes for faces.  Each pcurve is constructed and maintained independently of other pcurves on a given face; therefore, pcurves on a periodic surface or a surface with singularities may not meet end to end, implying that pcurves do not necessarily form a closed loop in parameter space.</p><div style="float:right;"><a href="http://doc.spatial.com/r18/index.php?title=Tutorial:ACIS_Tutorial_4:_The_basics_of_ACIS_geometry_%28Part_2%29&amp;action=edit" class="external text" title="http://doc.spatial.com/r18/index.php?title=Tutorial:ACIS_Tutorial_4:_The_basics_of_ACIS_geometry_%28Part_2%29&amp;action=edit" rel="nofollow"><span style="color: #000000">edit</span></a></div><a name="Other_Geometry-related_Topics"></a><h2> <span class="mw-headline"> Other Geometry-related Topics </span></h2><p>Before we present a couple C++ examples demonstrating the use of geometry in ACIS, there are a few more geometry-related topics we would like to present.</p><a name="Continuity_Requirements"></a><h3> <span class="mw-headline"> Continuity Requirements </span></h3><p>Many of the algorithms in ACIS are more efficient if curves and surfaces are smooth.  It is preferrable to have continuous second derivatives for these algorithms; i.e., curves and surfaces should be <tt>C_2</tt>; however, the minimum continuity requirement for geometry is that it must be at least <tt>G_1</tt>.  One algorithm that requires greater than <tt>G_1</tt> continuity is the algorithm for mass property evaluations which expects curves to be <tt>C_1</tt>.  </p><p>Translator developers should be aware that discontinuity information is maintained within the intcurve, int_cur, spline, and spl_sur classes.  For more information on continuity, see <a href="/r18/index.php?title=Continuity&amp;action=edit" class="new" title="Continuity">Continuity</a>.</p><a name="Senses"></a><h3> <span class="mw-headline"> Senses </span></h3><p>A number of the geometry and topology classes we have discussed have sense information in them.  Sense information allows an object to be in either the same direction or the opposite direction as the object underlying it.  For instance, a FACE may be oriented in the same direction or the opposite direction as the SURFACE underlying it.  If you are evaluating the normal direction at a point on a FACE, you must reverse the direction of the SURFACE normal if the FACE is reversed with respect to the SURFACE. The sense of the FACE is obtained by the FACE::sense( ) member function.  FACE::sense( ) returns a value that is either FORWARD or REVERSED. </p><p>In addition to FACES, several other classes in ACIS contain sense information.  The most commonly used classes that contain sense information are listed below.</p><table class="wikitable"><tr><th> Object</th><th> w.r.t. Object</th><th> Sense Determining Function</th></tr><tr><td> FACE</td><td> SURFACE</td><td> REVBIT FACE::sense( )</td></tr><tr><td> spline</td><td> spl_sur</td><td> logical spline::reversed( )</td></tr><tr><td> COEDGE</td><td> EDGE</td><td> REVBIT COEDGE::sense( )</td></tr><tr><td> EDGE</td><td> CURVE</td><td> REVBIT EDGE::sense( )</td></tr><tr><td> intcurve</td><td> int_cur</td><td> logical intcurve::reversed( )</td></tr><tr><td> PCURVE</td><td> bs2_curve</td><td> int PCURVE::index( )<p>(If index is -1 or -2, PCURVE is reversed w.r.t. bs2_curve.)</p></td></tr><tr><td> pcurve</td><td> par_cur</td><td> logical pcurve::reversed( )</td></tr></table><p>To demonstrate how senses are used let's look at how one might obtain the 3-dimensional location of a point 25% of the parametric distance along a COEDGE.  To obtain the parameter range of the COEDGE we must obtain the parameter range of its EDGE, and reverse it if the COEDGE is reversed with respect to the EDGE.  We then find the parameter value 25% of the way between the low and high parameter values.  We must then map this COEDGE parameter into a curve parameter, taking into account any reversals between the EDGE and CURVE and between the COEDGE and EDGE.  We then evaluate the curve at the appropriate curve parameter.  In C++ this looks like:</p><pre class="source-cpp"><span class="kw5">SPAinterval</span> edge_range = my_coedge-&gt;<span class="me3">edge</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me3">param_range</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<span class="kw5">SPAinterval</span> coedge_range = <span class="br0">&#40;</span>my_coedge-&gt;<span class="me3">sense</span><span class="br0">&#40;</span> <span class="br0">&#41;</span> == <span class="kw7">FORWARD</span><span class="br0">&#41;</span>&nbsp;? edge_range&nbsp;: -edge_range; <span class="kw4">double</span> coedge_param = coedge_range.<span class="me1">interpolate</span><span class="br0">&#40;</span>.<span class="nu0">25</span><span class="br0">&#41;</span>;<span class="kw4">double</span> curve_param = <span class="br0">&#40;</span>my_coedge-&gt;<span class="me3">sense</span><span class="br0">&#40;</span><span class="br0">&#41;</span> == my_coedge-&gt;<span class="me3">edge</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me3">sense</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>&nbsp;?     coedge_param&nbsp;: -coedge_param;<span class="kw5">SPAposition</span> loc = my_coedge-&gt;<span class="me3">edge</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me3">geometry</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me3">equation</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">eval_position</span><span class="br0">&#40;</span>curve_param<span class="br0">&#41;</span>;</pre><p>Of course, you could simply call coedge_param_pos(), which is declared in geometry.hxx.  In fact, this is the preferred approach because the code snippet above does not properly evaluate tolerant coedges.  </p><p>How would you find the parameter space location corresponding to the same point on a coedge?  (There are multiple solutions to this question.)</p><a name="Faces_on_Periodic_Surfaces"></a><h3> <span class="mw-headline"> Faces on Periodic Surfaces </span></h3><p>Different applications have different requirements for representing faces on periodic spline surfaces.  Some applications can represent only open spline faces.  These applications require closed or periodic faces to be split into two faces.  Other applications can represent a face on a periodic spline surface, if the face contains a seam edge, which splits the face in the periodic direction.  Other applications can represent a face on a periodic spline surface without a seam edge.  ACIS can maintain any of these representations.  (Prior to version 16 ACIS could not represent periodic spline faces without seam edges.)  </p><p>The requirement for a seam edge on a periodic spline face is controlled by the "periodic_no_seam" option.  If this option is TRUE, seams are not required; if it is FALSE, seams are required.  (Options are described in more detail in <a href="/r18/index.php/Tutorial:ACIS_Tutorials_%28Options%29" title="Tutorial:ACIS Tutorials (Options)">Tutorials (Options)</a>.)  If an application requires open faces, a periodic spline face with a seam edge can be split again along an isoparameter line using api_split_face( ).  Other periodic faces can be split using api_split_periodic_faces( ).  The "new_periodic_splitting" option controls the behavior of api_split_periodic_faces( ). </p><p><br /></p><a name="Using_a_Subset_of_a_Curve_or_Surface"></a><h3> <span class="mw-headline"> Using a Subset of a Curve or Surface </span></h3><p>Often an ENTITY or algorithm will use only a portion of a curve or a surface.  To support these cases ACIS allows a "subset range" to be associated with a curve or surface.  The following subsetting-related member functions apply to both curves and surfaces.  </p><table class="wikitable"><tr><th> Member Function</th><th> Description</th></tr><tr><td> limit( )</td><td> subsets a curve or surface in place</td></tr><tr><td> subset( )</td><td> creates a subsetted copy of the curve or surface</td></tr><tr><td> subsetted( )</td><td> determines whether a curve or surface has been subsetted or not</td></tr><tr><td> unlimit( )</td><td> removes the subset range from a curve or surface</td></tr><tr><td> unsubset( )</td><td> creates an unsubsetted copy of the curve or surface</td></tr></table><blockquote class="templatequote"><div><p><i><b>Note:</b>  param_range( ) returns the subsetted parameter range of a curve or surface.  Similarly functions to return the form or period of a curve or surface also take subsetting into account.  To examine the parameter range or form of the unsubsetted curve or surface, you must unlimit the curve or surface, perform the query, and then relimit the curve or surface.</i></p></div></blockquote><a name="Using_Transformations"></a><h3> <span class="mw-headline"> Using Transformations </span></h3><p>Transformations are used to change the position or orientation of objects within an ACIS model.  Transformations may contain translation, rotation, scaling, reflection, and shear components.  The most commonly used are probably translation and rotation.  If translations and/or rotations cause an object to be moved by a very large distance, a loss of numerical precision can occur.  Scaling can also cause geometric problems: small geometric inconsistencies can be magnified so they are no longer insignificant, and small features can be reduced so they are no longer significant.  Reflection will cause relative directions to change and shear can cause geometric types to change.  Application developers may want to restrict the transformation components available to their end users.  </p><p>Transformations are used in two ways in ACIS.  A transformation can be attached to a BODY and used by subsequent operations, or the transformation can be applied to the geometry of all the subordinant ENTITIES under the BODY.  Both approaches have advantages.  Simply attaching a transformation to a BODY allows multiple transformations to be applied to a BODY without affecting the underlying geometry.  This can reduce the "stack-up" error commonly associated with repeatedly applying transformation.  The disadvantage of this approach is that any geometric evaluations must take the transformation into account.  (Most geometric evaluation functions take optional transformation arguments for this purpose.)  Applying a transform to the geometry of all the subordinant ENTITIES under the BODY allows subsequent geometric evaluations to be done more efficiently (and may make debugging geometric problems more efficient); however, it also takes time to apply a transform and repeated application of transforms can cause "stack-up" errors.  Application developers should attempt to use transformations as efficiently as possible.  </p><p>Transformations are implemented using two classes: TRANSFORM and SPAtransf.  The TRANSFORM class is derived from ENTITY and is part of the persistent ACIS model.  Each TRANSFORM contains a SPAtransf, which contains the mathematical details of the transformation.  The following table describes the most commonly used transformation-related functions.</p><table class="wikitable"><tr><th> Function</th><th> Description</th></tr><tr><td> translate_transf(...)</td><td> Creates a SPAtransf that performs translation.</td></tr><tr><td> rotate_transf(...)</td><td> Creates a SPAtransf that performs translation.</td></tr><tr><td> scale_transf(...)</td><td> Creates a SPAtransf that performs scaling.<p>(If non-uniform scaling or shear is present this uses the Space Warping component.)</p></td></tr><tr><td> reflect_transf(...)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -