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

Version 1 Next »

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

https://docs.techsoft3d.com/exchange/latest/build/_a3_d_s_d_k_advanced_tools_8h.html#aab8b78e53cb8dab5d914300438e1e30c

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 A3DTopoBodyData::m_dScale, scale of representation item and product occurence
    doubel edgelength = curveLength * scale;
}					

  • No labels