QT C++ graphics display WIDGET

More
19 Oct 2021 07:20 #223525 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
yes it's a nml issue. 
I made a new nml alongside the app. That works, so I'm OK. 

I'm trying to hook the whole freecad into the the app or at least the part where I can use it as a shop-floor cad.
Just facing, pockets,drilling, pattern. You could make an interface to there planer: You could do that.

Do you know by now how to cut material away fast enough to keep up with the speed of the cnc without jocking. 
Could voxels do that.

Best regards.

Please Log in or Create an account to join the conversation.

More
19 Oct 2021 20:30 #223591 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
Have you seen this effect with the qt_occ screen ?

The little image in the lower left corner.
Attachments:

Please Log in or Create an account to join the conversation.

More
23 Oct 2021 19:57 #224026 by Grotius
Hi Udo,

I'm trying to hook the whole freecad into the the app or at least the part where I can use it as a shop-floor cad.
Just facing, pockets,drilling, pattern. You could make an interface to there planer: You could do that.


Yes, that could be done. I have been thinking to build a autocad clone. I think i can do that.
But coming time i spent some time finalizing a cnc machine interface program called "hal-core".

Have you seen this effect with the qt_occ screen ?
I don't know why you are asking this. Gradient and shades can be drawn with opencascade. It could also be
showing a failure.
 

Please Log in or Create an account to join the conversation.

More
23 Oct 2021 21:19 #224033 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
sorry- more accurat.

I think that background window is showing up with that little image in the lower left corner.
That little image expands as soon as I resize the window. ( occQt-sample ).
The error is " Window Visual is incomplete: no depth buffer, no stencil buffer."

I was trying to build a absolut minimum occ window into that tab. No luck so far. 

One more question: for how long did you have the graphics-Widget running at any given time.
As soon  as I start to update the values, it's eating up memory and then eventually crashes. HTOP.

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 10:07 #224080 by Grotius
Hi,

In the c++ examples you can see how the occ window is initialized only once it's loaded. This is done to set the screensize etc.
github.com/grotius-cnc/universal_graphic...t/releases/tag/1.0.0

As soon  as I start to update the values, it's eating up memory and then eventually crashes. HTOP.
Hi, i suspect you are creating multiple nml instances ("nml=new nml" ) over a period of time until it crashes.
In the above archive there is a nml example.

Please Log in or Create an account to join the conversation.

More
29 Nov 2021 18:54 #227937 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
Hi Mr Grotius
I was looking at your git-repo Hal-view.
I was wondering if I could implement it into my GUI. Looks like a nice fit.

Best regards.

Please Log in or Create an account to join the conversation.

More
29 Nov 2021 23:46 - 29 Nov 2021 23:51 #227958 by Grotius
Hi Udo,

I lost the source code. Ai. Only the executables are left over on the internet.
It's done like below code example.

Below example request's a actual component time wich can be divided trough the servo-thread time.
The result is the actual servo-load in %. The servo load is displayed on a label in the picture below.



Header example:
Warning: Spoiler!


source file example :
Warning: Spoiler!
Last edit: 29 Nov 2021 23:51 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Dec 2021 12:16 #229956 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
Hi Grotius
I'm still at your graphics-widget.
At present I try to implement a path-view.
The problem I have is that I get a real big amount of edges/wires to display.
If I use your g-code sample with a update rate of 50msec that piles up to some 20.000 chunks.
Here is the Code;
void Opencascade::drawTestPath3D(QVariant data)
{
    QStringList list=data.toStringList();
    double  x = list.at(0).toDouble();
    double  y = list.at(1).toDouble();
    double  z = list.at(2).toDouble();
    int     g = list.at(3).toInt();

    //**Get a new Point in 3D-Space at actual location *************
    gp_Pnt aTestPoint_p2{x, y, z};
    //double l= sqrt(pow(pathPoint_p2.X()-pathPoint_p1.X(),2)+pow(pathPoint_p2.Y()-pathPoint_p1.Y(),2)+pow(pathPoint_p2.Z()-pathPoint_p1.Z(),2));
    TopoDS_Edge aTopoDSEdgeShape;

    // make an edge;
    if((aTestPoint_p2.X() != aTestPoint_p1.X()) ||
       (aTestPoint_p2.Y() != aTestPoint_p1.Y()) ||
       (aTestPoint_p2.Z() != aTestPoint_p1.Z()))
        {
            aTopoDSEdgeShape = BRepBuilderAPI_MakeEdge(aTestPoint_p1,aTestPoint_p2);
            if( g == 0 )
                {
                    BRepBuilderAPI_MakeWire mkTestWire_G0;
                    mkTestWire_G0.Add(aTopoDSEdgeShape);
                    TopoDS_Wire myTestWire_TopoDS_Shape_G0 = mkTestWire_G0.Wire();


                    BRepLib::BuildCurves3d(myTestWire_TopoDS_Shape_G0);

                    //Handle(AIS_Shape) aTestEdge_Ais_Shape   = new AIS_Shape(aTestEdge_TopoDS_Shape);
                    //m_context->Remove(myTestWire_Ais_Shape_G0,    Standard_False);

                    Handle(AIS_Shape) myTestWire_Ais_Shape_G0      = new AIS_Shape(myTestWire_TopoDS_Shape_G0);

                    myTestWire_Ais_Shape_G0->SetColor(Quantity_NOC_YELLOW);

                    //aTestEdge_Ais_Shape->SetColor(Quantity_NOC_BLUE);
                    //m_context->Display(aTestEdge_Ais_Shape, Standard_False);
                    p_context->Display(myTestWire_Ais_Shape_G0,    Standard_False);
                    BRepTools::Write     (myTestWire_TopoDS_Shape_G0,"/home/udos/Downloads/myTestWire.txt");
                    aTestPoint_p1 = aTestPoint_p2;
                }

            if( g != 0 )
                {
                    BRepBuilderAPI_MakeWire mkTestWire_G1;
                    mkTestWire_G1.Add(aTopoDSEdgeShape);
                    TopoDS_Wire myTestWire_TopoDS_Shape_G1 = mkTestWire_G1.Wire();

                    BRepLib::BuildCurves3d(myTestWire_TopoDS_Shape_G1);

                    //Handle(AIS_Shape) aTestEdge_Ais_Shape   = new AIS_Shape(aTestEdge_TopoDS_Shape);
                    //m_context->Remove(myTestWire_Ais_Shape_G1,    Standard_False);

                    myTestWire_Ais_Shape_G1      = new AIS_Shape(myTestWire_TopoDS_Shape_G1);

                    myTestWire_Ais_Shape_G1->SetColor(Quantity_NOC_BLUE);

                    //aTestEdge_Ais_Shape->SetColor(Quantity_NOC_BLUE);
                    //m_context->Display(aTestEdge_Ais_Shape, Standard_False);
                    p_context->Display(myTestWire_Ais_Shape_G1,    Standard_False);

                    aTestPoint_p1 = aTestPoint_p2;
                }


       }

}
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Dec 2021 23:54 #230035 by Grotius
Hi Udo,

Is the problem to display 20.000 lines of gcode with opencascade ?
Running out of memory?
 

Please Log in or Create an account to join the conversation.

More
27 Dec 2021 09:31 - 27 Dec 2021 09:34 #230052 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius

Hi Grotius. Thanks for reply.

No, it is not. The total comes to about 15-20M for your example. The problem is the Redraw()  of the context.
As more edges/wires I get, the longer it takes to Redraw.
/// Pushback for Path *********************************************************
                    QStringList path;
                    path.push_back(QString::number(xAxisPosAbsACT));
                    path.push_back(QString::number(yAxisPosAbsACT));
                    path.push_back(QString::number(zAxisPosAbsACT));
                    path.push_back(G_Mode);
                    occ->drawTestPath3D(path);
                    occ->Redraw();
Thanks again for looking at it.
Last edit: 27 Dec 2021 09:34 by udoS.

Please Log in or Create an account to join the conversation.

Time to create page: 0.290 seconds
Powered by Kunena Forum