slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.29k stars 1.29k forks source link

Load parts from command line #4833

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello !! i'm working on a project to batch import STL files on Slic3r. It would be easy, but the thing is that, each object i have to print, contains 4 stl files :

lordofhyphens commented 5 years ago

Currently the load part functionality is specific to the GUI. If someone can figure out a good way to represent it on the CLI I'd be happy to take a PR.

ghost commented 5 years ago

OK, thanks for your reply. I understand that it can be hard to figure it out on the CLI, because additionnal parameters might be added to the parts, same as the main part. I think about it and come back as soon as possible. Thanks one more time !

lordofhyphens commented 5 years ago

If you can figure out a way to do it on the CLI, by all means write it up; it will help a lot in getting something like that implemented.

ghost commented 5 years ago

After washing my brain last night, i think that the easiest way is to provide an xml file to the CLI : -> Call it with (Under win) Slic3r.exe --loadParts file.xml Here is an xml example that reflects exactly my needs !!

<parts>
    <main-part>
        <file></file>
    </main-part>
    <part>
        <file></file>
        <bottom-solid-layers>0</bottom-solid-layers>
        <perimeters>0</perimeters>
        <fill-density>10%</fill-density>
    </part>
    <part>
        <file></file>
        <bottom-solid-layers>0</bottom-solid-layers>
        <perimeters>0</perimeters>
        <fill-density>20%</fill-density>
    </part>
</parts>

Also, i'm a profesionnal developper (sh, C, C++, Java, Perl, Python) with 10 years of experience, if i can help i'd be glad to do it :-) Waiting for your feedback ! Have a nice day.

lordofhyphens commented 5 years ago

@gfournetfayas We'd also need the relative positioning as parameters.

Slic3r is definitely more of a do-ocracy. I will happily assist in navigating the existing codebase and reviewing PRs, so if you want to work on this go for it.

lordofhyphens commented 5 years ago

Added tag to attract outside attention.

supermerill commented 5 years ago

I'm against xml, i prefer json as it's easier to write & parse.

dwillmore commented 5 years ago

I like the idea of having a plate description language, but I don't have an opinion on xml vs json--I'm not good at either.

I can see myself using this for some of the stuff I do. Right now I manually arrange a set of parts and save the platter as stl, but that lacks the ability to set different settings for each part, so this would be an imporvement. If @gfournetfayas writes this us and proposes a PR, I would support it.

ghost commented 5 years ago

I'm against xml, i prefer json as it's easier to write & parse.

I don't pay attention to this because i'll use a third part library to generate it, but i can understand that, if created manually, it's important to have a comprehensive language.

@supermerill : Where are you from (for my curiosity !!) ;-) ?

I like the idea of having a plate description language, but I don't have an opinion on xml vs json--I'm not good at either.

I can see myself using this for some of the stuff I do. Right now I manually arrange a set of parts and save the platter as stl, but that lacks the ability to set different settings for each part, so this would be an imporvement. If @gfournetfayas writes this us and proposes a PR, I would support it.

I'm sorry, but i'm a bit new for collborative work ! What do i do now ?

@gfournetfayas We'd also need the relative positioning as parameters.

Slic3r is definitely more of a do-ocracy. I will happily assist in navigating the existing codebase and reviewing PRs, so if you want to work on this go for it.

@lordofhyphens : Thanks for your help and proposal. If i don't make a mistake, the relative position is automatic, not asked when doing that from the GUI; maybe a default value ?

lordofhyphens commented 5 years ago

What's next is to get a checkout of the source. Fork the repository and make a new branch. Do your work in that branch and then make a pull request against Slic3r/master when it is ready for review.

Keep discussing here about the shape it should take.

lordofhyphens commented 5 years ago

It is fine to specify relative position compared to the main part in whatever you use.

I believe we have a XML parser already in our dependencies. We do not have a json parser and I would rather not invent one (nor should we have to).

hyperair commented 5 years ago

Slic3r already has a config bundle format. Can't we just use the same format? You could have one section per file, and the keys in there would specify the overrides necessary for that particular file. Example:

[file:foo.stl]
bottom_solid_layers = 0
perimeters = 0
fill_density = 10%

[file:bar.stl]
bottom_solid_layers = 0
perimeters = 0
fill_density = 20%
bubnikv commented 5 years ago

The AMF / 3MF formats already support importing all the data required. Shouldn't one not build upon these formats?

pá 28. 6. 2019 v 5:43 odesílatel Chow Loong Jin notifications@github.com napsal:

Slic3r already has a config bundle format. Can't we just use the same format? You could have one section per file, and the keys in there would specify the overrides necessary for that particular file. Example:

[file:foo.stl]bottom_solid_layers = 0perimeters = 0fill_density = 10% [file:bar.stl]bottom_solid_layers = 0perimeters = 0fill_density = 20%

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slic3r/Slic3r/issues/4833?email_source=notifications&email_token=ABMPSI5ZDRTZXUH7Q3HEDGTP4WCF3A5CNFSM4H3R7OV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYY64IY#issuecomment-506588707, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMPSI4HMU7DL5KHG2QMKKDP4WCF3ANCNFSM4H3R7OVQ .

ghost commented 5 years ago

The AMF / 3MF formats already support importing all the data required. Shouldn't one not build upon these formats? pá 28. 6. 2019 v 5:43 odesílatel Chow Loong Jin notifications@github.com napsal: Slic3r already has a config bundle format. Can't we just use the same format? You could have one section per file, and the keys in there would specify the overrides necessary for that particular file. Example: [file:foo.stl]bottom_solid_layers = 0perimeters = 0fill_density = 10% [file:bar.stl]bottom_solid_layers = 0perimeters = 0fill_density = 20% — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#4833?email_source=notifications&email_token=ABMPSI5ZDRTZXUH7Q3HEDGTP4WCF3A5CNFSM4H3R7OV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYY64IY#issuecomment-506588707>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMPSI4HMU7DL5KHG2QMKKDP4WCF3ANCNFSM4H3R7OVQ .

Hello, you're right, but sometimes, you don't manage what you receive and it's my case. Dealing with STL is mandatory for me as i don't have the hand on the previous process.

supermerill commented 5 years ago

+1 with bubnikv, Why not creating a little utility that package 3D model, config file and transformation into a .3mf?

But the current parser parse only the geometry (as far as i can read), or the one developed for prusaslicer needs to be ported back into mainline.

@bubnikv : why do you add "; " at every line in the config file?

ghost commented 4 years ago

Back on it. I think this answer is the right one, why rewrite something existing ?!

Slic3r already has a config bundle format. Can't we just use the same format? You could have one section per file, and the keys in there would specify the overrides necessary for that particular file. Example:

[file:foo.stl]
bottom_solid_layers = 0
perimeters = 0
fill_density = 10%

[file:bar.stl]
bottom_solid_layers = 0
perimeters = 0
fill_density = 20%

I will start to write code now. @lordofhyphens : I have some questions to start on the good way, are you a little bit free to help me ? Thanks in adavnce.

lordofhyphens commented 4 years ago

Start with tests :)

ghost commented 4 years ago

Start with tests :)

In theory you are right, but i never used TDD method. Could i send you questions in private ? This could be helpull :-)

lordofhyphens commented 4 years ago

Pretty simple.

  1. Figure out what you want to do.
  2. Write a couple simple tests towards the code doing what you want to do.
  3. Make the code pass those tests.
  4. Write a few more tests.
  5. Goto 3