Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier to use as a library and Z Hop on retraction #54

Merged
merged 2 commits into from
Nov 5, 2022

Conversation

ivano85
Copy link

@ivano85 ivano85 commented Oct 28, 2022

In this pull request I made the "model" struct public, to be easier to write custom readers and writers without copying too much from the original library's code. For instance, I wrote my own reader and writer for reading and wrinting in memory STL and GCode. I think I will provide more updates on this topic in the future.

Then I added support for lifting head when retraction happens, because I'm using the library to build test gcodes (levelling, thin walls, etc.) and I would need this feature.

P.S.: thank you for your great work!

@aligator
Copy link
Owner

aligator commented Nov 2, 2022

Hi,

thank you, I will look at at the next days😃

@aligator aligator merged commit 179c510 into aligator:master Nov 5, 2022
@aligator
Copy link
Owner

aligator commented Nov 5, 2022

oh shit git ^^
didn't mean to merge it yet, sorry :-)
I rolled back the master, so effectively you just have to re-open a new merge request. I cannot reopen it here...

However I will post the change requests here.

@@ -429,6 +432,7 @@ func DefaultOptions() Options {
InitialTemperatureLayerCount: 3,
RetractionSpeed: 30,
RetractionLength: Millimeter(2),
RetractionZHop: 0,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the Option also to the cli options (in ParseFlags)

@@ -151,17 +157,36 @@ func (g *Builder) AddPolygon(currentLayer data.PartitionedLayer, polygon data.Pa
}

if isCrossing {
Copy link
Owner

@aligator aligator Nov 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that if zHop is 0, the resulting gcode should not differ from the gcode generated before your changes.

-> Please use the g.AddCommand like before to preserve the special retraction speed. That retraction speed should also apply if zHop is enabled.
-> I think better:
Add a new func (g *Builder) AddMoveSpeed(p data.MicroVec3, extrusion data.Millimeter, speed int) and modify the AddMove function to also use that.
Then you can just use AddMoveSpeed with the special retraction speed. And we avoid the (quite hacky) AddCommand I used before.

@ivano85 ivano85 mentioned this pull request Nov 6, 2022
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