Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Get length of a edge using A3DCurveLength which computes the length of a curve with interval of edge

https://docs.techsoft3d.com/exchange/latest/api/A3DSDKAdvancedTools_8h.html?highlight=a3dcurvelength#_CPPv414A3DCurveLengthPK10A3DCrvBasePK15A3DIntervalDataP9A3DDouble

A3DTopoEdgeData sData;
A3D_INITIALIZE_DATA(A3DTopoEdgeData, sData);
A3DTopoEdgeGet(pEdge, &sData);
const A3DCrvBase* p3DCurve = nullptr;
if (sData.m_p3dCurve != nullptr)
		p3DCurve = sData.m_p3dCurve;
else
{  
	const A3DEntity* pBrep; // A3DRiBrepModel
	A3DRiBrepModelData sRiBrepData;
	A3D_INITIALIZE_DATA(A3DRiBrepModelData, sRiBrepData);
	A3DRiBrepModelGet(pBrep, &sRiBrepData);
	A3DTopoEdgeGetOrCompute3DCurve(sRiBrepData.m_pBrepData, pEdge, &p3DCurve);
}
if (p3DCurve)
{
	double curveLength = 0.0;
	A3DCurveLength(p3DCurve, sData.m_bHasTrimDomain ? &sData.m_sInterval : NULL, &curveLength);
    // Apply A3DTopoContextData::m_dScale, scale of representation item and product occurence
    doubel edgelength = curveLength * scale;
}					

  • No labels