Conversion 2D/3D

Everything DG Kernel: Technical discussions and issues
Post Reply
useme
Posts: 5
Joined: Fri Feb 21, 2025 6:06 pm

Conversion 2D/3D

Post by useme »

In the documentation for Arc Spline Curves https://dynoinsight.com/Help/V7_2/AX/Ge ... Curve.aspx it is stated that "The frames can be accessed by querying IFrameArray_DG from IArcSpline3DCurve_DG". Please give me a hint on how to do that, I cannot find a method to query this array from a IArcSpline3DCurve_DG previously defined through individual points, normals and curvatures. Thanks!
Mike Zubovic
Posts: 40
Joined: Mon Jul 15, 2024 5:20 am

Re: Conversion 2D/3D

Post by Mike Zubovic »

Hello useme

Please try something like this:
IFrameArray_DG iFrameArr = theCurve.Query<IFrameArray_DG>();

If you search for IFrameArray_DG in the samples, you will find a debuggable working example in eMotion sample.

Regards
useme
Posts: 5
Joined: Fri Feb 21, 2025 6:06 pm

Re: Conversion 2D/3D

Post by useme »

Hi Nick,

I have tried unsuccessfully the equivalent in Visual Studio 2022 in VB: iFrameArr=TryCast(iPath, IFrameArray_DG), being iPath defined as Dim iPath As IArcSpline3DCurve_DG = m_gen.Create("IArcSpline3DCurve_DG") and iFrameArr as IFrameArray_DG=m_gen.Create("IFrameArray_DG"). I also tried iFrameArr=iPath. Does not work.

In fact inspired by the eMotion sample I was seeking to define a general IMove_DG by a generic trajectory as IArcSpline3DCurve_DG following the procedure next:

Dim R As Double = 2 'just for trial purposes
'0. DECLARATIONS
Dim iMove As IMove_DG = m_gen.Create("IMove_DG")
'iMove.CreateAttributes(MoveParametrisationType_DG.eMoveParametrisationTypeArcSpline)
Dim iPath As IArcSpline3DCurve_DG = m_gen.Create("IArcSpline3DCurve_DG")
'Dim iPath As IArcSpline3DCurve_DG = m_gen.Create(EObjectType.eObjTypeArcSplineCurve)
Dim iCurve As ICurveFreeForm_DG = m_gen.Create("ICurveFreeForm_DG")
Dim iPoints As IPointArray_DG = iCurve.GetData()
If iPoints.GetCount() = -1 Then Return Nothing
'1. DEFINE SPLINE POINTS
iPoints.SetCount(4) 'Two ends of the arc
'iPoint = SplinePoints
iPoints.SetPoint1(0, 0, 0, 0)
iPoints.SetPoint1(1, -1, 0, 0)
iPoints.SetPoint1(2, -2, 0, 0)
iPoints.SetPoint1(3, -4, 0, 0)
'
'2. DEFINE SPLINE
Dim radii As IArrayDouble_DG = m_gen.Create("IArrayDouble_DG")
radii.SetCount(iPoints.GetCount())
For i As Integer = 0 To iPoints.GetCount() - 1
radii.SetAt(i, R)
Next
iPath = iCurve.ConstructFilletedLineStrip(radius:=R)
'3. DEFINE NORMALS
Dim iNormals As IPointArray_DG = iPath.GetSplineNormals()
Debug.WriteLine("Normals={0:N0}", iNormals.GetCount())
iNormals.SetPoint(0, createP(0, 1, 0)) ' Plane of the arc is parallel to x,z plane
'
'4. DEFINE CURVATURES
Dim iCurvatures As IArrayDouble_DG = iPath.GetCurvatureArray()
Debug.WriteLine("Curvatures={0:N0}", iCurvatures.GetCount())
iCurvatures.SetAt(0, 1 / R)
'5. DEFINE MOVEMENT
iMove.SetOriginPath(iPath)
iMove.DefineTangential()
'
Debug.WriteLine("iMove defined")
'
'iFrameArr = iMove.GetFrameArray()
iFrameArr = iPath
'iFrameArr = TryCast(iPath, IFrameArray_DG)
Debug.WriteLine("Number= " & iFrameArr.ToString)

And was expecting to have a FrameArray that could be used in KinematicSet with other objects...

I am stucked. Sorry if there is an evident error that I cannot identify by myself.

Best regards,
Marcos
Mike Zubovic
Posts: 40
Joined: Mon Jul 15, 2024 5:20 am

Re: Conversion 2D/3D

Post by Mike Zubovic »

You are right. We have reproduced it in a small test. There is a bug in the IArcSpline3DCurve_DG > IFrameArray_DG query in the internal DGK code.
There should be an update soon.
Thank you for reporting.
Regards
Post Reply