Skip to content

Work in progress: Loop depth Refactor + useful scripts#26

Draft
L-A-Sutherland wants to merge 6 commits intoGeekDetour:mainfrom
L-A-Sutherland:wall-depth-rewrite
Draft

Work in progress: Loop depth Refactor + useful scripts#26
L-A-Sutherland wants to merge 6 commits intoGeekDetour:mainfrom
L-A-Sutherland:wall-depth-rewrite

Conversation

@L-A-Sutherland
Copy link
Contributor

Major changes to allow collecting all inner perimeters on a layer before calculating loop depth.

Around hole is not currently set in this version.

split parse loop into three loops to hopefully improve readability.
attempted to create more accurate depth by using winding number method described here.

image
Offset layer shown in as type custom in preview.
image
Error on Benchy, where travel extrudes only occurs on layer at z=18.20

Probably a lot more problems with this that I haven't spotted yet, but I thought I'd share progress.

refactored loop to allow collecting walls to process at the end of the layer.
rewrote build_loop_tree as build_loop_tree_bidirectional: not sure if it is faster
need to add back functionality that was lost while refactoring: wipes, travel, etc.
@L-A-Sutherland L-A-Sutherland marked this pull request as draft March 24, 2025 14:33
@GeekDetour
Copy link
Owner

Hi there @L-A-Sutherland Wow man, I am so overwhelmed to see you working on this too.

I don't know what to do with your Pull Request, because if it is breaking parts, then it is not 'better'.

On the other hand, the effort to actually get a better analisys of the DEPTH is very nice.

I am curious: I was using Bounding Boxes because they are super fast and so far, it worked very nice. I am intrigued if actually analisiing the Geometry at a more intricate level will make the script considerably slower.

For Readability and Mantainability, I am about to Separate BrickLayers into several Python Files - basically one per Class, or at least groups of related classes. That will become a Python Package (from which we will be able to test directly like today).... But In the "root" of the repository, I will automatically generate a "unified" (flattened) file that glues everything together - so people that are not interested in the development can continue downloading just 1 file for their convenience.

What do you think about it?

@L-A-Sutherland
Copy link
Contributor Author

I couldn't notice any change in execution time when using the point in polygon method. In theory it's more accurate than the bounding box method, but cases where it makes a difference are rare.

Splitting the file is a good idea. At the very least giving the classes BrickLayersProcessor and GCodeSimulator their own files would make things easier.

As for what to do with this pull request, in it's current state I think it's not ready. I'd want to at least get hole detection working; probably by tracking the external perimeters the same way as the internal and doing some kind of search. The main reason I created this pull request draft was just to report back what I had been working on and share ideas.

Also could I get you to upload a gcode file where the order of the loops cause a problem? it would be good to see if this actually fixes the example from your video.

…ed in winding calculation.

Changed offset layer to use custom type instead of internal perimeter to make depth easier to see.
@GeekDetour
Copy link
Owner

@L-A-Sutherland Luke, I would love to talk to you. How can y reach out to you an chat?! Do you use Discord? If so, write a message to me: eversonsiqueira
If not, tell me how to reach you. Are you a scientist at CSIRO? Or I got the wrong Luke?

@L-A-Sutherland
Copy link
Contributor Author

L-A-Sutherland commented Mar 25, 2025

I am a different Luke, I'll message you on discord.
Edit: apparently discord doesn't let you send messages to someone unless you are friends or share a server, So for now friend request. We can work out a time to chat on there, I'm about to go to bed so it'll be a while before I respond.

@L-A-Sutherland
Copy link
Contributor Author

image
Fixed the Benchy problem. Turns out it was caused by me missing a new line at the end of the inserted travel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants