Vertex modification problem

Technical discussions
Post Reply
motif
Posts: 4
Joined: Fri Jul 12, 2019 3:52 am

Vertex modification problem

Post by motif »

Hello

I am trying modification of a shape consisting of planar faces. I have an issue there. I do not see any exceptions. The change just does not take effect. I have reduced my code to this:

Code: Select all

	   BRepBuilder_DG myBuilder;
		…
            IPlane_DG pln = (IPlane_DG)m_gen.Create("Plane_DG");
            IBRepFace_DG f = myBuilder.CreateFace1(pln);

            PointDg p0 = new PointDg();
            PointDg p1 = new PointDg(1, 0, 0);
            PointDg p2 = new PointDg(0, 1, 0);
            IBRepWire_DG wire = myBuilder.CreateWire2(p0, p1, p2, true);

            f.AddWire(wire);
            
            IBRepEdge_DG e = wire.GetEdge(0);
            IBRepVertex_DG v = wire.GetVertex(0);

            myBuilder.ModifyVertex2(v, 0.1, e, f);
            
            myModel.AddBRepShape(f as IBRepShape_DG);
Can anybody see a problem?
Thanks in advance

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Vertex modification problem

Post by Prashant Kande »

Hello motif

I am pretty sure the problem is that curve of the adjacent edge2 is geometrically out of sync. Its second end remains in the old position. So the wire becomes broken. The algorithm does not do anything automatic there.
Try this:

Code: Select all

		…
	     	myBuilder.ModifyVertex2(v, 0.1, e, f);

 	    	PointDg p0Modified = v.GetPosition1();
            ILine_DG line = m_gen.Create("Line_DG") as ILine_DG;
            line.Init1(p2, pt0Modified);
            IBRepEdge_DG edge2 = wire.GetEdge(2);
            edge2.SetCurve(line as ICurve_DG);
            
            myModel.AddBRepShape(f as IBRepShape_DG);
regards

motif
Posts: 4
Joined: Fri Jul 12, 2019 3:52 am

Re: Vertex modification problem

Post by motif »

Thanks a lot, Prashant

Post Reply