cnckitchen / gradientinfill Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This is a very clever method and I can't wait to try it out. I followed your isntructions and have the python script saved inside the scripts directory. I ran Cura 4.8, sliced a cyliner, clicked on Extensions > Post Processing > Modify Gcode and clicked on add script. GradientInfill was not there. Restarted Cura. Same result. Rebooted everything. Same thing or did I mess up somewhere?
My thought is to use a standard 'Y = A*X^B + C' curve (with user-defined A, B, & C) for the edges to give complete leeway in how the gradient is defined.
Hi just generate some gcode with cura 4.7 in ubuntu with setting proposed in instrucctions but still get the next error when running from command line the python script "python addGradientInfillCLI.py -i FQQS_foilmast.gcode"
File "addGradientInfill.py", line 125, in getXY
return Point2D(float(elementX), float(elementY))
ValueError: could not convert string to float:
seems the parsing is reading some string instead of numbers but don't know why it could be.
Any ideas?.
python used was python 3.7 but tried with python 2.7 but get another error:
File "addGradientInfillCLI.py", line 35
def arg_to_infill_type(arg: str) -> InfillType:
^
SyntaxError: invalid syntax
Yet you manage to write some of the cleanest, best-annotated Python code I've ever read. Bravo!
I love the type hints and the lack of external dependencies.
A couple of small suggestions which are more style/approach opinions than anything else:
Again, excellent work!
Could be interesting to convert this script into a Cura Postprocessing script to test the potential of this new infill method without running the script from a Python IDE and necessity to modify the File Input and Output name.
As usual @smartavionics have done a great job and produced one of his great Cura Master Release with the Gradient Infill option in the experimental section
On github :
smartavionics/Cura#38
I had the idea that you could potentially implement your desired end goal of topologically defined infill by just post-processing an existing infill method and moving segment points to match the desired density profile. This could be used together with or instead of your current ideas of modifying extrusion amount and feed rate.
Essentially you could evaluate the density at each point (e.g. by distance to closest neighbour, or just to the ends of its segments for a small segment infill), and compare that to the density field that you'd like at that point (e.g. somehow get your stress as a function of position, or to start with just use your 'distance to closest wall' function). From there you can iteratively shift all the infill line points that aren't on perimeters to closer or further from their two nearby points, in order to get closer to the desired densities. The more iterations you run, the closer you get to your desired state.
You can end the optimisation at either a set number of iterations, or a maximum error from the desired densities (this is how very basic machine learning systems work - just iterative progress of an optimisation).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.