几何尺寸与公差论坛

 找回密码
 注册
查看: 2871|回复: 5

How to get such parameters as qualityIndex, TessMin, qualityNum, TessMax, Bod

[复制链接]
发表于 2007-5-20 09:55:53 | 显示全部楼层 |阅读模式
Q:
Robin,

How to get such parameters as qualityIndex, TessMin, qualityNum, TessMax, BodyDiameter, Deviation?

Yogy
 楼主| 发表于 2007-5-20 09:56:12 | 显示全部楼层

回复: How to get such parameters as qualityIndex, TessMin, qualityNum, TessMa

R:
BodyDiameter is the diagonal distance across the bounds of the part box. See [url=mkMSITStore:Cocuments%20and%20SettingsrrichterMy%20Documentsmydocshelpapi%2007sldworksAPI.chm::/PartDoc/PartDoc__GetPartBox.htm]PartDoc::GetPartBox[/url] for details.

Use ModelDocExtension::GetUserPreferenceDoubleValueRange with swImageQualityShadedDeviation to get the TessMax and TessMin.

qualityNum is the number set in ModelDoc2::SetTessellationQuality.

qualityIndex can be calculated using the first equation.





Robin Richter
 楼主| 发表于 2007-5-21 09:13:37 | 显示全部楼层

回复: How to get such parameters as qualityIndex, TessMin, qualityNum, TessMa

Q:
Robin,

Thanks.

How to get TessMin?

tessDeviation result which is calculated by my code is 83 according to your formula. Which unit does tessDeviation used?

If its unit is meter, it looks that tessDeviation value is too large.

My code as follows:

      // get qualityNum

      long qualityNum = dModelDoc.GetTessellationQuality();

      // get TessMax

      double tessMax = dModelDoc.GetUserPreferenceDoubleValue ( swImageQualityShadedDeviation);

      dModelDoc.DetachDispatch();

      // get qualityIndex

      double qualityIndex = qualityNum  / 100 * tessMax;

      if (qualityIndex > 0)

            tessDeviation = bodyDiameter  / qualityIndex * 0.025;

return tessDeviation;



Are you sure the following formula is correct? Pls check it and tell me the correct formula.

qualityIndex = TessMin + qualityNum*((TessMax-TessMin)/100)

Deviation = 0.025 * (BodyDiameter) / qualityIndex

Yogy
 楼主| 发表于 2007-5-21 09:14:00 | 显示全部楼层

回复: How to get such parameters as qualityIndex, TessMin, qualityNum, TessMa

R:
The number returned by ModelDoc2.GetTessellationQuality () is the quality index.  The “quality number” is the number you pass to SetTessellationQuality.  The formulas are correct, but you don’t need the first formula when using ModelDoc2.GetTessellationQuality ().



Robin Richter
 楼主| 发表于 2007-5-21 09:17:25 | 显示全部楼层

回复: How to get such parameters as qualityIndex, TessMin, qualityNum, TessMa

Q:
Robin,

I don’t think so. I need your strict and patient guidance.

I found that quality number was equal as quality index.

   long qualityNumber = 100;

dModelDoc.SetTessellationQuality(qualityNumber);

// qualityIndex is 100 in watch window

   long qualityIndex = dModelDoc.GetTessellationQuality();

As view as your given formula, qualityIndex value is between TessMin and TessMax and its unit is meter.

qualityIndex = TessMin + qualityNum*((TessMax-TessMin)/100)

Example:

Consider TessMax is 0.001, TessMin is 0 and qualityNum is 100, qualityIndex is 0.001.

But, as view as SW_API help doc, qualityIndex should be number, not value with unit.

SW_API help doc as follows:

Number between 0 and 100 that indicates the quality of tessellation to use for this part; a higher index means finer tessellation

Yogy
 楼主| 发表于 2007-5-21 09:17:48 | 显示全部楼层

回复: How to get such parameters as qualityIndex, TessMin, qualityNum, TessMa

R:
Sorry, I made a mistake in my last email.  The number returned by GetTessellationQuality is the quality Number.



Use the qualityIndex returned by the formula to find the deviation.



Robin Richter
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 19:03 , Processed in 0.040863 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表