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

📄 acis_tutorials_(acis_tolerances).htm

📁 acis说明文档
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<p>Ahhh.  If only life were that simple.</p><p>ACIS does use one tolerance for 99 percent of its geometric calculations.  That tolerance is SPAresabs, or simply resabs for short.  (resabs is pronounced "rez-abs.")  resabs is the tolerance used to compare two positions in the 3-dimensional model space.  If two positions are within resabs of each other, they may be considered the same position.  </p><p>Of course, what does it mean for "two positions to be within resabs of each other"?  If two positions are precisely resabs apart, are they within resabs of each other?  How does one deal with the imprecision due to floating point arithmetic on computers?  The answer to these questions is, it doesn't really matter as long as you are consistent.  To be consistent you must always perform the same comparison the same way.  In ACIS if you want to compare two positions using a resabs tolerance you simply use <i>operator== (SPAposition const&amp;, SPAposition const&amp;)</i> or <i>same_point (SPAposition const&amp;, SPAposition const&amp;)</i>.  </p><p>But how can you perform geometric calculations in a 1-dimensional or 2-dimensional parameter-space using a 3-dimensional model-space tolerance?  </p><p>The answer is relatively straight forward: you map the 1-dimensional or 2-dimensional parameter-space values into the 3-dimensional model-space and perform positional comparisons in the 3-dimensional model-space.  If this is done, all of your geometric modeling calculations will be done consistently.</p><p>Occasionally you will want to compare two vectors instead of two positions.  How can you compare the directions of two vectors if all ACIS has is a positional tolerance?  </p><p>Well, just for this purpose ACIS has another tolerance, SPAresnor, or resnor for short.  (resnor is pronounced "rez-nor.")  resnor is used when comparing the directions of two vectors.  If the directions of two vectors are within resnor of each other, the vectors may be considered parallel.  As with positions, consistency matters, so all comparisons should be performed using one of the <i>parallel (SPAvector const&amp;, SPAvector const&amp;)</i>, <i>antiparallel (SPAvector const&amp;, SPAvector const&amp;)</i>, <i>biparallel (SPAvector const&amp;, SPAvector const&amp;)</i>, or <i>perpendicular (SPAvector const&amp;, SPAvector const&amp;)</i> functions.  Hopefully, you are beginning to see that the ACIS math classes are not only convenient, but they also provide a means of making consistent calculations, which makes ACIS and your application more robust.</p><p>But wait a minute!  Initially we said we wanted to use a single tolerance for all calculations and then we introduced a second tolerance for vectors.  How can some geometric calculations be made with one tolerance and other geometric calculations be made with another tolerance, and we still expect to produce consistent results???</p><p>The answer is simple: resnor depends on resabs.</p><p>In order to understand the relationship between resnor and resabs we must introduce a measure of the longest distance in the model.  If you think of a bounding box surrounding your model, the longest possible distance is the length of the longest diagonal.  So, if we have two vectors that are the length of longest possible vector in your model and they are parallel to each other to within a tolerance, what does this mean?  Let's look at the figure below in which we have set the maximum deviation between the two vectors to be resabs. </p><div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:541px;"><a href="/r18/index.php/Image:Resnor_definition.jpg" class="image" title="Two long vectors that deviate by resabs"><img alt="Two long vectors that deviate by resabs" src="/r18/images/c/cb/Resnor_definition.jpg" width="539" height="85" border="0" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify" style="float:right"><a href="/r18/index.php/Image:Resnor_definition.jpg" class="internal" title="Enlarge"><img src="/r18/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Two long vectors that deviate by resabs</div></div></div></div> <p>If we want the maximum possible deviation between the two vectors to be resabs, and the vectors are the longest length possible, what is the maximum angle between them?  resnor.So what is the relationship between resnor and resabs?</p><p><br /></p><dl><dd> <tt>resnor = resabs/longest_dist</tt> </dd></dl><p><br />We can of course rearrange the equation to:</p><p><br /></p><dl><dd> <tt>longest_dist = resabs/resnor</tt> </dd></dl><p><br />Which means that if we have a pair of values for resabs and resnor, we have effectively set the longest distance in the model.   But if we constrain ourselves to using that as the longest distance in the model, we can use resnor for angular measurements and know that vector displacements will be less than resabs.  In other words, if our model is less than some calculatable size, then we still are using one tolerance for all our geometric calculations. </p><p>At this point we should probabably state what we mean by "all our geometric calculations."  We really mean geometric comparisons.  We don't mean to imply that resabs ever is used for a convergence criterion in an iterative geometric algorithm.  In fact, quite the opposite is true.  Geometric algorithms in ACIS iterate to criteria many orders of magnitude tighter than resabs.  This reduces the possibility of tolerance stack up errors.  What does this mean for you, the user?  When you evaluate a geometric quantity using ACIS, the error associated with the calculations of that quantity is well within resabs.  </p><p>But, you might ask, are there ever times when something doesn't need to be calculated that precisely?  When an approximation will do?</p><p>Yes.  ACIS does use b-spline approximations for some types of procedural curves and surfaces to speed up algorithms.  This does not mean that the procedural curves and surfaces are represented as b-splines.  There just may be be b-spline approximations to make some algorithms more efficient.  In fact, developers of some algorithms, such as algorithms to display graphics, may choose to use only the approximations rather than the precise representations for increased efficiency.  B-spline approximations are generally calculated using a tolerance of SPAresfit, or simply resfit. </p><p>For the sake of completeness there is one additional tolerance in ACIS, SPAresmch, or simply resmch. (This is pronounced "rez-machine.")  resmch is seldomly used.  It is the tolerance associated with floating point calculations on a double precision computer.  Because of the numerical stack up, it is set a few orders of magnitude greater than the precision of a double precision word.  resmch does not vary with various platforms, but rather it is kept constant to achieve consistent results among various platforms.</p><p>The default values for these tolerances are:</p><table class="wikitable"><tr><th> Tolerance type</th><th> Value</th></tr><tr><td> SPAresabs</td><td> 1e-6</td></tr><tr><td> SPAresnor</td><td> 1e-10</td></tr><tr><td> SPAresfit</td><td> 1e-3</td></tr><tr><td> SPAresmch</td><td> 1e-11</td></tr></table><p>Although SPAresabs, SPAresnor, SPAresfit and SPAresmch are variables, we would <i>strongly</i> recommend that you do not change their values in your application.  Changing their values could significantly affect the robustness of your application.  </p><p>For more information on global tolerances you may refer to <a href="/r18/index.php?title=Tolerance_Variables&amp;action=edit" class="new" title="Tolerance Variables">Tolerance Variables</a>, <a href="/r18/index.php?title=Scaling_Tolerance_Variables&amp;action=edit" class="new" title="Scaling Tolerance Variables">Scaling Tolerance Variables</a>, and <a href="/r18/index.php?title=Dynamic_Range&amp;action=edit" class="new" title="Dynamic Range">Dynamic Range</a>.</p><a name="Aside:_Choosing_Units_for_an_Application"></a><h2> <span class="mw-headline"> Aside: Choosing Units for an Application </span></h2><p>If SPAresabs, SPAresnor, SPAresfit and SPAresmch shouldn't be changed, how can applications represent models with a wide range of sizes?</p><p>ACIS is unit-less.  ACIS doesn't have any concept of an inch, or a meter, or a mile.  The units which you the developer choose to use in your application, or the end user is allowed to use in his session, are up to you.  Furthermore, the units that the end user sees do not need to be the units used in the internal representation.  </p><p>Let's assume you are designing an application that needs to model the air space over the continental United States.  The longest distance in the continental U.S. is less than 3000 miles or 5000 kilometers.  If longest_dist = resabs / resnor, then longest_dist = 10,000. So if we represent the data using kilometers we shall never have a vector longer than 10,000 units.  The absolute resolution of the model (resabs) would be 1e-6 kilometer, or 1 millimeter, which is probably sufficient for any application modeling the entire United States.  The user interface could present information to the user in whatever units were most appropriate: kilometers, miles, feet, etc. </p><p>Another way of looking at resnor is it sets the <i>dynamic range of the model</i>.  It is the ratio of the smallest representable distance to the largest representable distance.  The exponent of its inverse (10) is a measure of the number of significant figures in the data.  In other words, the data in an ACIS model has 10 significant figures.  This is just a function of word sizes on 32-bit computers.  (You could design an application that modeled assemblies, in which each object instanced in the assembly was an ACIS model, and in this case the assembly could <i>appear</i> to have more than 10 significant figures, but the data in each ACIS model would have only 10 significant figures.) </p><a name="Local_Tolerances"></a><h2> <span class="mw-headline"> Local Tolerances </span></h2><p>Occasionally data in ACIS models will not meet ACIS global tolerances. This typically occurs when models are imported from other systems, but occasionally it occurs when modeling is performed using ACIS modeling functions.  For instance, one may create two BODIES, each of which meets the ACIS globals tolerances, but the BODIES may be oriented such that their combination would not meet ACIS global tolerances.  FACES, EDGES, and VERTICES on the two BODIES may be nearly coincident, but not precisely coincident.  How does ACIS deal with these types of situations?  </p><p>In these cases ENTITIES that do not meet global tolerances can be represented using tolerant ENTITIES.  If a VERTEX does not lie on an EDGE to within SPAresabs, the VERTEX can be represented as a TVERTEX which contains a local tolerance which specifies the maximum positional error in the TVERTEX. If an EDGE does not lie on a FACE to within SPAresabs, the EDGE can be represented as a TEDGE which contains a local tolerance which specifies the maximum positional error in the TEDGE. </p><p>All ACIS algorithms should be able to process TVERTICES and TEDGES.  This means that if the algorithm encounters a tolerant ENTITY it uses the tolerance contained within the ENTITY rather than resabs for positional comparisons.  In addition some ACIS algorithms may propagate tolerant ENTITIES.  As an example, if you were to offset a body with tolerant edges and vertices, you should expect that the offset body will also contain tolerant edges and vertices.  </p><p>What are the preferred ways to make positional comparisons using tolerant ENTITIES?  </p><p>1) The best way is to use an ACIS API function.  ACIS contains many functions that can aid you in making positional comparisons.  Perhaps the most obvious is the Boolean function for comparing to BODIES, api_boolean(...).  But there is another function to make this comparison more efficient if you just want to know whether the BODIES are separate or intersecting, api_clash_bodies(...).  The table below contains some of the most frequently used API functions that you can use to make geometric comparisons.</p><table class="wikitable"><tr><th> Function</th><th> Description</th></tr><tr><td> api_boolean( )</td><td> Can be used to generate the intersection between two BODIES.</td></tr><tr><td> api_clash_bodies( )</td><td> Determines if two BODIES "clash", and optionally the nature of the clash.</td></tr><tr><td> api_clash_faces( )</td><td> Determines if two FACES "clash" and the nature of the clash.</td></tr><tr><td> api_edent_rel( )</td><td> Determines the spatial relationship between an EDGE and another ENTITY.</td></tr><tr><td> api_edfa_int( )</td><td> Generates the intersection between an EDGE and a FACE.</td></tr><tr><td> api_entity_entity_distance( )</td><td> Determines the minimum distance between to ENTITIES.</td></tr><tr><td> api_entity_entity_touch( )</td><td> Determines if two ENTITIES touch.</td></tr><tr><td> api_entity_point_distance( )</td><td> Determines the distance between a point and an ENTITY.</td></tr><tr><td> api_fafa_int( )</td><td> Generates the intersection between two faces.</td></tr><tr><td> api_find_cls_ptto_face( )</td><td> Determines the point on a FACE nearest a given point.</td></tr><tr><td> api_find_vertex( )</td><td> Determines the VERTEX on a BODY nearest a given point.</td></tr><tr><td> api_intersect( )</td><td> Generates the intersection between two BODIES.</td></tr><tr><td> api_intersect_curves( )</td><td> Determines the intersection between two EDGES or their underlying curves.</td></tr><tr><td> api_planar_slice( )</td><td> Generates the wire BODY representing the intersection between a plane and a BODY.</td></tr><tr><td> api_point_in_body( )</td><td> Determines whether a point lies inside, outside, or on the boundary of a BODY.</td></tr><tr><td> api_point_in_face( )</td><td> Determines whether a point lies inside, outside, or on the boundary of a FACE.<p>The point is assumed to lie on the surface of the FACE.</p></td></tr><tr><td> api_ptent_rel( )</td><td> Determines the spatial relationship between a point and an ENTITY.</td></tr></table><p><br />2) If you must make positional comparisons in your code...<br/></p><dl><dd>a) If you are comparing a SPAposition with an EDGE (or VERTEX) the tolerance value should be the maximum of the value returned by EDGE::get_tolerance( ) (or VERTEX::get_tolerance( )) and SPAresabs.  For example when comparing a SPAposition with a vertex, <i>vert</i>:</dd></dl>

⌨️ 快捷键说明

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