Need help for faster processing


RE: Need help for faster processing
#2
(2023-11-02, 21:12)Max Murtazin Wrote: For a while, I've been writing a custom LDraw to Collada converter for Bricklink Studio, as the one currently in the program is, to put it lightly, sucks

Have a problem with it's performance of finding and merging same vertex positions

Here's the code for one I have currently:

...

In short, it subdivides space in sections, in each of which it checks each pair of vertices on if they are close enough to be considered the same, or not. Wonder if there is a way to make it faster

LDView has a custom vertex key class that it uses specifically for merging vertices. The class converts the coordinate values from floats to long (with a scale factor that represents how close together they need to be in each axis) and implements the less than operator. I then use std :: set and std :: map with these vertex keys, and nearby points automatically get merged. I'm not sure if this would be faster than what you're doing or not. Something similar could be done without conversion from float to long. On modern CPUs, I'm honestly not sure how much that conversion helps.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Need help for faster processing - by Travis Cobbs - 2023-11-02, 21:26

Forum Jump:


Users browsing this thread: 1 Guest(s)