Home
Reply
Trusted Contributor
Tim
Posts: 14

R21 Faceter

We updated from R20 to R21 SP1 our CAD products yesterday and now doing testing.  The most notable difference is the significant performance degradation of the faceter.  

 

We seeing about 200 percent performance hit on our test files.

 

The release notes provides a heads up that faceting may be slower and suggests adjusting our tolerances : IE double the normal deviation. In fact it is mentioned the default refinement was changed from 15 to 30 and that your in house test cases now generate half as many facets.  

 

In our test files, doubling the normal deviation impacts display quality. Did this not impact your in house quality tests as well or am I missing something in our implementation?

 

Setting the version to R20 when we call api_facet_entity gets us back our prior performance.

 

Should I expect the same performance/quality with the R21 faceter? 

 

 

Thanks!

Tim Olson

Encore Software

Spatial Employee
asdf
Posts: 93

Re: R21 Faceter

Hi Tim

 

How are you specifying tolerances?  Are you using a default facet options object (i.e., not passing it in to the api), or are you doing something else?

 

Our internal testing showed much less of a performance problem between the R21 default tolerances and the R20 default tolerances.

 

The crucial issue here is that R20 wasn't obeying the tolerances that you asked for as well as R21 does.  You would ask for 15 degrees normal tolerance and the actual normal deviation (i.e., max angle between normal vectors at adjacent points on the facet mesh) was often very much greater.  In contrast, R21 meets the tolerances you ask for the vast majority of the time.

 

The thing you should not do is use facet options expert to use the same refinements you were using before with R21.  R20 does not obey tolerances but R21 does (most of the time).  As a result, you will get a better mesh but more slowly.  We strongly recommend reconsidering the tolerances you use when you use R21.

 

I am anxious to help you resolve this issue.  Internally we get much better performance (in terms of facet count and fidelity to the surface), and similar performance (in terms of speed) with R21.  We would very much like to see customers get these same benefits in their applications.

 

 

Eric

Spatial Employee
gweedo
Posts: 14

Re: R21 Faceter

More insights:  There are two main controls people usually use for faceting: surface tolerance and normal tolerance.  I would first look at the surface tolerance you are using. The old faceter used that tolerance as a guide or target, but wasn't required to meet that tolerance.  The new faceter will produce more facets to meet that tolerance; hence the results are more predictable and faceting results scale better as the tolerance changes.  Take a model that is performing too slow or producing too many facets.  Loosen the surface tolerance and evaluate the quality.  Also, we have added a new control: edge factor.  This uses the surface tolerance, multplies it by edge factor, and uses that number for facets that lie on the edge.  By setting that to 0.5 you can get finer facets along the edge. This is available only in facet_options, so you may want to simply switch from refinements to facet_options.

Trusted Contributor
Tim
Posts: 14

Re: R21 Faceter

We expose a medium, fine, very fine type UI to our customers. Internally these settings are mapped to normal deviations. We use the default tolerances for the other tolerances.  We then apply these using api_set_entity_refinement.  These basic settings are used for visualization.   We also have advanced settings that expose most of the refinement attributes  where performance is not a priority.

 

So if I understand correctly, normal deviation in R21 is better applied such that I should be able to go from 15 to 30 with similar quality.   Is that also the case for analytics as well as NURBs?

 

Thanks for the quick reply!

 

Tim Olson

Encore Software

Spatial Employee
asdf
Posts: 93

Re: R21 Faceter

Hi Tim

 

I think I understand what your application is doing.  To be sure I will paraphrase in code

 

double normal_tolerances_for_quality = {

15, // coarse

10, //medium

5 // fine

};

 

facet_options_visualization fov;

int quality_level = get_application_quality_level();

fov.get_expert_options().set_normal_tolerance( normal_tolerances_for_quality[quality_level] );

//...

api_facet_entity( ent, &fov );

 

======

Now some comments:

 

  •  We designed facet_options_visualization to specifically support an interface like yours.  The easiest thing to do would be use facet_options_visualization and control face_quality and or edge_quality to set your toggle switch.  We have spent some time optimizing this.
  •  A huge selling point of the new algorithm is that it does just as well on spline surfaces as it does on analytic surfaces.  You should only need to set tolerances once, without regard for what the surface type is.
  • There were bugs that caused surface tolerance to be missed by a little bit for analytics in R20: specifically, the diagonals of quads did not always meet tolerance.  We have fixed those.
  • If you choose not to use facet_options_visualization to control quality, but use facet_options_expert instead, it is easier to get slow and/or lower quality results.  With that in mind, here are some guidelines for expert mode.
  1. The flags set_check_and_generate_pcurves and set_do_narrow_region_repair may have more of an impact on performance than the tolerance settings per se.
  2. Surface tolerance is a better primary control of facet quality than normal tolerance because it gives big features more facets.  This allows similar visible quality with many less facets.  (Think of a circle.  To facet it you need 360/15 = 24 facets whether it has radius 1000 or 1e-3.  For visualization, the circle of radius 1000 matters a lot more than the circle of radius 1e-3).
  3. To amplify the previous point: I have done experiments with large parts faceting with either normal or surface tolerance as a primary control.  Using normal tolerance 45 degrees and surface tolerance in the neighboorhood of 1/4000*(model bounding box diag) gives visually acceptable results with many fewer (i.e., a factor of 4 or 5) as compared to using 15 or 20 degrees normal tolerance.

 

Because there are so many dials, it is hard to make precise comparisons with regard to faceting speed, but you should be able to do better than a factor of two worse than before.  Moreover, I would be very surprised if you cannot get usable results with significantly fewer facets than you had with R20.  Please let us know (either here or via customer support) if you run into further problems.  

 

best regards

 

Eric