Transforming a wire for evolve operation

Everything DG Kernel: Technical discussions and issues
Post Reply
Hugo D
Posts: 1
Joined: Sun Oct 06, 2024 5:06 pm

Transforming a wire for evolve operation

Post by Hugo D »

Hi,

I´m struggling to find a way to orient a wire prior to iBrepBuilderEx_DG.Evolve(wireProfile, wireSpine, ...).

I am aware of using IFrame_DG or IGeometricObject and the differences, but for both I need to create an entity to get through GetLocation() or GetGeometry() the interface.

When I do this the wire makes the transformation, but the original wire does not. How can I put back the modified geometry to the wire prior to Evolve?

This is what I am doing:

Code: Select all

       Dim ProfileWire As IBRepWire_DG = CreateWireFromPoints(ProfilePoints, closed:=True)
        Dim tWire As IBRepWire_DG = ProfileWire
        '
        Dim tEntity As IEntity_DG = mModel.AddBRepShape(tWire)

        Dim iScene As IScene_DG = mView.GetScene()
        iScene.ShowLocalFrame(tEntity, True)
        '
        Dim iGeo As IGeometricObject_DG = tEntity.GetGeometry()
        Dim iFrame As IFrame_DG = tEntity.GetLocation()
        '
        iFrame.TranslateGlobal1(0, -30, -25)
        iFrame.RotateGlobal(-90 * DEG, createV(0, 0, 1))
        iFrame.TranslateGlobal1(origin.x(0), origin.x(1), origin.x(2))
        '
        ProfileWire = tEntity.GetGeometry() or ProfileWire=iGeo same result

        later  iShapeOp = iBuilderEx.Evolve(iWireProfile, iWireSpine, JoinType_DG.eJoinTypeArc, True, True)
evolve works but with original location done at creation (it is not copied)
The Evolve operation requires a wire. If I do this with EvolveFace similar result!
The Evolve operation is done on the wire with initial (creation) location and orientation.

What can I do to avoid this to happen?

Thanks in advance,
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Transforming a wire for evolve operation

Post by Prashant Kande »

Hello Hugo

Your code has issues, like iGeo is not used, but it is the right idea to use IGeometricObject_DG.
We have found an issue with querying IGeometricObject_DG from IBRepShape_DG. It was fixed in today's 5541 update of v7.2.

I have tested the transformation on v6.2 Solids sample. It works OK.

Code: Select all

Private Sub BuildEvolved()
    Dim points As IPointArray_DG = m_iGener.Create("IPointArray_DG")
    points.Add1(0, 0, 0)
    points.Add1(200, 0, 0)
    points.Add1(200, 200, 0)
    points.Add1(0, 200, 0)
    Dim wireBase As IBRepWire_DG = m_iGener.Create("IBRepWire_DG")
    wireBase.InitFromPoints(points, True)

    Dim iGeo As IGeometricObject_DG = wireBase
    iGeo.Translate1(40.0, 0.0, 0.0)
    iGeo.Rotate1(0.5 * Math.PI, 0, 1, 0)

    points.RemoveAll()
    points.Add1(0, 0, 0)
    points.Add1(-60, -60, -200)
    Dim wireProfile As IBRepWire_DG = m_iGener.Create("IBRepWire_DG")
    wireProfile.InitFromPoints(points, False)
    Dim iBuilderEx As IBRepBuilderEx_DG = m_iGener.Create("IBRepBuilderEx_DG")
    Dim shapeEvolved = iBuilderEx.Evolve(wireBase, wireProfile, JoinType_DG.eJoinTypeArc, True, True)
    m_iModel.AddBRepShape(shapeEvolved)
    m_iView.Reset(True, True)
End Sub
Complete project: Download.
Post Reply