QT C++ graphics display WIDGET
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
27 Dec 2021 10:34 - 27 Dec 2021 10:35 #230054
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi,
I think i understand your question.
You are drawing a toolpath. And this is stacking up huge ammounts of points or segments to draw.
Yes, this is a problem if it's done a few times a second.
I think when you do it a little different, the result is better, like:
If you have a point to push back. You monitor how far the tcp has moved by a function like:
double dist=sqrt(pow(x,2)+pow(y,2)+pow(z,2);
if(dist>3){
path.push_back(Point)
}
for(double i=0; i<pathpoints.size(); i++){
Construct a linestrip or segments.
}
In above way, it only add's a new item if the distance to previous point has a minimal value. It will not pile up a unlimited
ammount of points related to the qui refresh rate.
I think i understand your question.
You are drawing a toolpath. And this is stacking up huge ammounts of points or segments to draw.
Yes, this is a problem if it's done a few times a second.
I think when you do it a little different, the result is better, like:
If you have a point to push back. You monitor how far the tcp has moved by a function like:
double dist=sqrt(pow(x,2)+pow(y,2)+pow(z,2);
if(dist>3){
path.push_back(Point)
}
for(double i=0; i<pathpoints.size(); i++){
Construct a linestrip or segments.
}
In above way, it only add's a new item if the distance to previous point has a minimal value. It will not pile up a unlimited
ammount of points related to the qui refresh rate.
Last edit: 27 Dec 2021 10:35 by Grotius.
Please Log in or Create an account to join the conversation.
- udoS
- Offline
- Elite Member
Less
More
- Posts: 216
- Thank you received: 25
27 Dec 2021 10:47 #230056
by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
Yes, you are right, but that only reduces the problem. It doesn't solve it.
Plus, e.g. small holes look ugly. Corners too.
Any other idea ?
Yes, you are right, but that only reduces the problem. It doesn't solve it.
Plus, e.g. small holes look ugly. Corners too.
Any other idea ?
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
27 Dec 2021 12:50 #230063
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi Udo,
Indeed it doen't solve the problem. It just hurt's less.
I did not try this before, but drawing just a pixel at the toolpath could be the best way.
Avoiding making shapes with opencascade.
Try to find a function that draws a pixel in the occ screen at a certain xyz point. This should be possible somehow.
If you construct a std::vector<PIXEL> for this. You can empty the toolpath at once.
Indeed it doen't solve the problem. It just hurt's less.
I did not try this before, but drawing just a pixel at the toolpath could be the best way.
Avoiding making shapes with opencascade.
Try to find a function that draws a pixel in the occ screen at a certain xyz point. This should be possible somehow.
If you construct a std::vector<PIXEL> for this. You can empty the toolpath at once.
Please Log in or Create an account to join the conversation.
- udoS
- Offline
- Elite Member
Less
More
- Posts: 216
- Thank you received: 25
07 Jan 2022 07:12 #231015
by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
For now my solution is to display just the last 1000 edges. That is just around 50 msec update-time.
For now my solution is to display just the last 1000 edges. That is just around 50 msec update-time.
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
10 Jan 2022 05:06 #231281
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi,
Nice video. You made progress !!
Nice video. You made progress !!
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds