ad-si / brickify

Speed up 3D printing using LEGO® bricks
9 stars 1 forks source link

rewrite Voxel / Layout Datastructure #294

Closed AtiX closed 9 years ago

AtiX commented 9 years ago

Current datatructure is very inefficent and causes re-layout (when adding adjacent bricks) to be very, very slow

Steditor commented 9 years ago

A lot of CPU-time is wasted with repeated array searches and manipulations, especially "removeFirstOccurenceFromArray". A few numbers after playing around with the 3D-Brush on the ballista:

stuikomma commented 9 years ago

As an intermediate step we might replace the Brick neighbors arrays with ES6 Sets. A huge amount of time is spent on deduplication of neighbors (which happens in the addNeighbor method mentioned above).