Giter VIP home page Giter VIP logo

gradientinfill's People

Contributors

5axes avatar beeb avatar bondarevts avatar cnckitchen avatar erezlevanon avatar rkarlsba avatar xengi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradientinfill's Issues

Not showing up in post processing drop down list

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?

Any reason to use Inner_wall to test distance ?

Between Inner-wall and Outer-wall there is not a big difference to test the distance with the infill elements. But Outer-profil are normaly smaller ( just one contour ) so computation time is faster.
compare

FeatReq: User defined curves

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.

ValueError: could not convert string to float:

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

"I'm a mechanical engineer, not a programmer"

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:

  • In the main loop, you might consider making the main processing function which expects iter(lines_of_gcode) and returns (or better yet yields) lines as an iterator. Move the file i/o to another function which takes the input file, iterates the lines into the processor, and writes out. The thinking here is to make it easier to eventually integrate into a slicer/gcode pipeline
  • I see that there are some comments for syntax using F-strings - IMHO stick with .format for this script and target py3.5-3.7 for compatibility
  • Personally, I would parse and validate a line of gcode/comment in a single spot, rather than e.g. #L265 checking if "E" in the string in multiple places. Here's an example regex for parsing gcode. There are python gcode parsers out there, but I like the lack of deps, pip can be daunting for the general audience. No need to get crazy with classes, just a namedtuple or class with slots to contain the values of the fields, or None if not present. Or a dict where keys are letter codes.
  • I'd give process_gcode() some sane default parameters
  • Add an examples folder with known input/output pairs so contributors can validate their output

Again, excellent work!

Why not move points?

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.