flow calibration first version
Port from SuperSlicer
BIN
resources/calib/filament_flow/0_v1.jpg
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
resources/calib/filament_flow/0_v2.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/O.amf
Normal file
BIN
resources/calib/filament_flow/_0.amf
Normal file
95
resources/calib/filament_flow/filament_flow.html
Normal file
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Filament Flow Calibration</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;">
|
||||
<h1>Filament Flow Calibration</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;"><strong>
|
||||
<table><tr><td>Needs:</td>
|
||||
<td style="text-align: left;">Bed Leveling</td></tr>
|
||||
</table>
|
||||
</strong>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><strong>You need to do the bed level calibration before this one.</strong></p>
|
||||
<p>This test will print five test samples with various level of flow. You can choose the flow difference between each steps. You should start with the 10% one.
|
||||
After verifying the result with the help of the table below, you have to modify the filament extrusion multiplier in your filament preset (if the -20 is the best, change the multiplier from 1 to 0.8, see the formula below). Don't forget to save it afterwards! You can continue with the 2.5 step if you want a bit more precision.</p>
|
||||
<h2>Results</h2>
|
||||
<h4>Example:</h4>
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./m20.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m10.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./0_v1.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./p10.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./p20.jpg" width="150" height="150" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">Not flat</td>
|
||||
<td style="text-align: center;">Not flat</td>
|
||||
<td style="text-align: center;">Not flat</td>
|
||||
<td style="text-align: center;">Flat<br />but the circle<br />isn't that good</td>
|
||||
<td style="text-align: center;">Flat surface<br />and good circle</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>The flow you want to choose is the lowest that does not create gaps in the top surface. In this example it seems that the good flow is below +20. So you have to change your extrusion multiplier to 1.2 and print the second set of test (or put 1.15 and call it a day).</p>
|
||||
<p>Don't look at the surface quality of the letter, it should be only good at the 0, as it's for this flow we calibrated the bed height. Here, going with +20% flow, you should lower the bed a bit (redoing the bed level calibration).</p>
|
||||
<h4>Second step, starting from +20%:</h4>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./m8.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m6.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m4.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m2.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./0_v2.jpg" width="150" height="150" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">Not good</td>
|
||||
<td style="text-align: center;">Not good</td>
|
||||
<td style="text-align: center;">Almost good</td>
|
||||
<td style="text-align: center;">Good but the<br />circle has some<br />irregularities</td>
|
||||
<td style="text-align: center;">Good</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Here we can see the loop is not very good in the -8 and -6. The -4 is almost round but not quite, so it indicates that the nozzle has lost pressure. -2 is almost good but the 0 is the only one that can be considered as "good", and even so the loop isn't perfect. </p>
|
||||
<h2>How to tune your printer</h2>
|
||||
<p>You have to change the extrusion multiplier for the filament you calibrate for (and save it). Formula for the new extrusion multiplier: new_multiplier = ( (100 + chosen_number) / 100 ) * old_multiplier<br />
|
||||
Example: first step, i choose the -10, so i have ((100-10)/100) * 1 = (0.9) * 1 = 0.9<br />
|
||||
second step i choose +5, so i have ((100+5)/100) * 0.9 = (1.05) * 0.9 = 0.945
|
||||
</p>
|
||||
<p>If you want to make this change permanent and left your extrusion multiplier to 1 in Slic3r, you can change your firmware configuration by multiplying (or dividing, depends of the firmware/setting) the 'extruder speed setting' (e-step, step_distance) by this extrusion multiplier.</p>
|
||||
<h2>Advice</h2>
|
||||
<p>Before doing this test, it's preferable to calibrate your extruder (it's easier on bowden setup):</p>
|
||||
<ul>
|
||||
<li>Remove the extruder bowden tube from the output of the extruder (or remove the extruder assembly from the nozzle assembly if you have a direct-extruder)</li>
|
||||
<li>Put the filament through it (by hand or using the software control)</li>
|
||||
<li>Cut the filament flush with the output of the extruder. Measure with your spring-steel ruler that you measure just 0mm. If not, note the value and don't forget to remove it from every other measure you do.</li>
|
||||
<li>Ask your extruder to extrude 200mm of filament (gcode: G1 E200).</li>
|
||||
<li>Measure the length of the extruded filament. Repeat this process two times more if you want more precision.</li>
|
||||
<li>You have to change your extruder multiplier (estep, step_distance) by multiplying (or dividing, depending on your firmware) the current value by (200 / average_measured_value).</li>
|
||||
<p>Note that this value may change if you change the pressure the extruder exerts against the filament.</p>
|
||||
</ul>
|
||||
<h2>Notes</h2>
|
||||
<p>It's very difficult to tune the flow below the 2% mark, and no filament is consistent enough to warrant it anyway. Filaments that have a guarantee of +-0.03mm has a ~7% variation between the low and high end cross section.</p>
|
||||
<p>Most of the calibrations need to be done in the right order. This one should be second.</p>
|
||||
<p>You may want to re-do the bed level calibration if the result is below 0.9 or higher than 1.1.</p>
|
||||
<p>Note that the filament extrusion multiplier can change with a different filament material, as a softer one can be squished/dented more by the extruder and so have a lower diameter in the extruder gears.</p>
|
||||
<p>If your printer extruder 'eats' the filament and can't complete the top layer, you will have to increase the ironing distribution (by 5% increments). (Expert setting, print -> infill)</p>
|
||||
<p>This test sets the setting "Complete individual objects" to true, so you may want to reset your print settings afterwards</p>
|
||||
<p>Licence for models used for this calibration test: CC BY-SA 3.0</p>
|
||||
</body>
|
||||
</html>
|
BIN
resources/calib/filament_flow/filament_flow_test_cube.amf
Normal file
92
resources/calib/filament_flow/fr_filament_flow.html
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Calibration du débit du filament</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;">
|
||||
<h1>Calibration du débit du filament</h1>
|
||||
</td>
|
||||
<td style="text-align: right;"><strong>
|
||||
<table><tr><td>besoins:</td><td style="text-align: left;">Mise à niveau du plateau</td></tr>
|
||||
</table>
|
||||
</strong>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><strong>Vous devez effectuer l'étalonnage du niveau du plateau avant celui-ci..</strong></p>
|
||||
<p>Ce test imprimera cinq échantillons de test avec différents niveaux de débit. Vous pouvez choisir la différence de débit entre chaque étape. Vous devriez commencer par celui à 10%.
|
||||
Après avoir vérifié le résultat à l'aide du tableau ci-dessous, vous devez modifier le multiplicateur d'extrusion du filament dans votre réglage de filament (si le -20 est le meilleur, changez le multiplicateur de 1 à 0,8, voir la formule ci-dessous). N'oubliez pas de le sauvegarder ensuite ! Vous pouvez continuer avec le pas de 2% si vous voulez un peu plus de précision.</p>
|
||||
<h2>Résultats</h2>
|
||||
<h4>Exemple:</h4>
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./m20.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m10.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./0_v1.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./p10.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./p20.jpg" width="150" height="150" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">pas plat</td>
|
||||
<td style="text-align: center;">pas plat</td>
|
||||
<td style="text-align: center;">pas plat</td>
|
||||
<td style="text-align: center;">plat<br />Mais le cercle<br />n'est pas si bon</td>
|
||||
<td style="text-align: center;">Surface plane<br />et bon cercle</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Le débit que vous voulez choisir est le plus faible qui ne crée pas de trous dans la surface supérieure. Dans cet exemple, il semble que le bon débit soit inférieur à +20. Vous devez donc modifier votre multiplicateur d'extrusion à 1,2 et imprimer la deuxième série de tests (ou mettre 1,15 et s'arrêter là).</p>
|
||||
<p>Ne regardez pas la qualité de surface de la lettre, elle ne doit être bonne qu'au 0, car c'est pour ce débit que nous avons calibré la hauteur du plateau. Ici, en partant avec un débit de +20%, il faut baisser un peu le plateau (en refaisant la calibration du niveau du plateau).</p>
|
||||
<h4>Deuxième étape, à partir de +20%.:</h4>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./m8.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m6.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m4.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./m2.jpg" width="150" height="150" /></td>
|
||||
<td><img src="./0_v2.jpg" width="150" height="150" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">Pas bon</td>
|
||||
<td style="text-align: center;">Pas bon</td>
|
||||
<td style="text-align: center;">Presque bon</td>
|
||||
<td style="text-align: center;">Bon<br />Mais le cercle<br />a quelques<br />irrégularités</td>
|
||||
<td style="text-align: center;">Bon</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Ici, nous pouvons voir que le cercle n'est pas très bon dans les modèles -8 et -6. Le -4 est presque rond mais pas tout à fait, il indique donc que la buse a perdu de la pression. Le -2 est presque bon mais le 0 est le seul qui peut être considéré comme "bon", et même ainsi le cercle n'est pas parfaite. </p>
|
||||
<h2>Comment régler votre imprimante</h2>
|
||||
<p>Vous devez modifier le multiplicateur d'extrusion pour le filament pour lequel vous calibrez (et le sauvegarder). Formule pour le nouveau multiplicateur d'extrusion : nouveau_multiplicateur = ( (100 + nombre_choisi) / 100 ) * ancien_multiplicateur<br />
|
||||
Exemple : première étape, je choisis le -10, donc j'ai ((100-10)/100) * 1 = (0.9) * 1 = 0.9<br />
|
||||
deuxième étape, je choisis +5, donc j'ai ((100+5)/100) * 0.9 = (1.05) * 0.9 = 0.945
|
||||
</p>
|
||||
<p>Si vous voulez rendre ce changement permanent et laisser votre multiplicateur d'extrusion à 1 dans SuperSlicer, vous pouvez changer la configuration de votre firmware en multipliant (ou divisant, selon le firmware/réglage) le 'réglage de la vitesse de l'extrudeuse' (e-step, step_distance) par ce multiplicateur d'extrusion.</p>
|
||||
<h2>Conseils</h2>
|
||||
<p>Avant de faire ce test, il est préférable de calibrer votre extrudeuse (c'est plus facile sur une installation bowden) :</p>
|
||||
<ul>
|
||||
<li>Retirez le tube Bowden de l'extrudeuse de la sortie de l'extrudeuse (ou retirez l'ensemble de l'extrudeuse de l'ensemble de la buse si vous avez une extrudeuse directe).</li>
|
||||
<li>Passez le filament à travers (à la main ou en utilisant le logiciel de contrôle).</li>
|
||||
<li>Coupez le filament au ras de la sortie de l'extrudeuse. Mesurez avec votre règle en acier à ressort que vous ne mesurez que 0mm. Si ce n'est pas le cas, notez la valeur et n'oubliez pas de l'enlever de toutes vos autres mesures.</li>
|
||||
<li>Demandez à votre extrudeuse d'extruder 200mm de filament (gcode : G1 E200).</li>
|
||||
<li>Mesurez la longueur du filament extrudé. Répétez ce processus deux fois de plus si vous voulez plus de précision.</li>
|
||||
<li>Vous devez modifier le multiplicateur de votre extrudeuse (estep, step_distance) en multipliant (ou divisant, selon votre firmware) la valeur actuelle par (200 / average_measured_value).</li>
|
||||
<p>Notez que cette valeur peut changer si vous modifiez la pression que l'extrudeuse exerce sur le filament.</p>
|
||||
</ul>
|
||||
<h2>Notes</h2>
|
||||
<p>Il est très difficile de régler le débit en dessous de la barre des 2%, et aucun filament n'est assez régulier pour le justifier de toute façon. Les filaments qui ont une garantie de +-0.03mm ont une variation de ~7% entre la section transversale basse et haute.</p>
|
||||
<p>La plupart des calibrations doivent être effectuées dans le bon ordre. Celui-ci devrait être le deuxième.</p>
|
||||
<p>Vous devrez peut-être refaire l'étalonnage du niveau du plateau si le résultat est inférieur à 0,9 ou supérieur à 1,1..</p>
|
||||
<p>Notez que le multiplicateur d'extrusion du filament peut changer avec un matériau de filament différent, car un filament plus mou peut être plus écrasé/marqué par l'extrudeuse et donc avoir un diamètre plus faible dans les engrenages de l'extrudeuse.</p>
|
||||
<p>Si l'extrudeuse de votre imprimante "mange" le filament et ne peut pas terminer la couche supérieure, vous devrez augmenter la répartition du repassage (par incréments de 5 %). (Réglage expert, impression -> repassage)</p>
|
||||
<p>Ce test définit le paramètre "Compléter les objets individuels" à Vraie, donc vous pouvez vouloir réinitialiser vos paramètres d'impression par la suite.</p>
|
||||
<p>Licence pour les modèles utilisés pour cet essai de calibration: CC BY-SA 3.0</p>
|
||||
</body>
|
||||
</html>
|
BIN
resources/calib/filament_flow/m10.amf
Normal file
BIN
resources/calib/filament_flow/m10.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/m2.amf
Normal file
BIN
resources/calib/filament_flow/m2.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/m20.amf
Normal file
BIN
resources/calib/filament_flow/m20.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/m4.amf
Normal file
BIN
resources/calib/filament_flow/m4.jpg
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
resources/calib/filament_flow/m6.amf
Normal file
BIN
resources/calib/filament_flow/m6.jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
resources/calib/filament_flow/m8.amf
Normal file
BIN
resources/calib/filament_flow/m8.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/p10.amf
Normal file
BIN
resources/calib/filament_flow/p10.jpg
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/calib/filament_flow/p20.amf
Normal file
BIN
resources/calib/filament_flow/p20.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
resources/calib/flowrate_0.stl
Normal file
BIN
resources/calib/flowrate_10.stl
Normal file
BIN
resources/calib/flowrate_15.stl
Normal file
BIN
resources/calib/flowrate_20.stl
Normal file
BIN
resources/calib/flowrate_5.stl
Normal file
BIN
resources/calib/flowrate_m10.stl
Normal file
BIN
resources/calib/flowrate_m15.stl
Normal file
BIN
resources/calib/flowrate_m2.stl
Normal file
BIN
resources/calib/flowrate_m20.stl
Normal file
BIN
resources/calib/flowrate_m4.stl
Normal file
BIN
resources/calib/flowrate_m5.stl
Normal file
BIN
resources/calib/flowrate_m6.stl
Normal file
BIN
resources/calib/flowrate_m8.stl
Normal file
|
@ -1228,7 +1228,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"Can't be zero");
|
||||
def->sidetext = L("mm³/s");
|
||||
def->min = 0;
|
||||
def->max = 50;
|
||||
def->max = 200;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloats { 2. });
|
||||
|
||||
|
|
|
@ -2466,6 +2466,12 @@ void MainFrame::init_menubar_as_editor()
|
|||
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("PA - Bowden"), _L("Calibrate PA - Bowden"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_pa(true); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Flowrate - Pass 1"), _L("Flowrate - Pass 1"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(1); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Flowrate - Pass 2"), _L("Flowrate - Pass 2"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(2); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
#else
|
||||
m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File")));
|
||||
if (editMenu)
|
||||
|
@ -2485,6 +2491,12 @@ void MainFrame::init_menubar_as_editor()
|
|||
append_menu_item(claib_menu, wxID_ANY, _L("PA - Bowden"), _L("Calibrate PA - Bowden"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_pa(true); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
append_menu_item(claib_menu, wxID_ANY, _L("Flowrate - Pass 1"), _L("Flowrate - Pass 1"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(1); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
append_menu_item(claib_menu, wxID_ANY, _L("Flowrate - Pass 2"), _L("Flowrate - Pass 2"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(2); }, "", nullptr,
|
||||
[this]() {return m_plater->is_view3D_shown();; }, this);
|
||||
|
||||
m_menubar->Append(claib_menu,wxString::Format("&%s", _L("Calibration")));
|
||||
|
||||
|
|
|
@ -7873,6 +7873,245 @@ void Plater::calib_pa(bool bowden) {
|
|||
|
||||
p->background_process.fff_print()->is_calib_mode() = bowden ? Calib_PA_Bowden : Calib_PA_DDE;
|
||||
|
||||
}
|
||||
//
|
||||
//void Plater::calib_flowrate(int pass) {
|
||||
// if (pass != 1 && pass != 2)
|
||||
// return;
|
||||
// const auto calib_name = "Flowrate Test";
|
||||
// new_project(false, false, calib_name);
|
||||
// if (pass == 1) {
|
||||
// std::vector<size_t> res = load_files(std::vector<std::string>{
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_0.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_5.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_15.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_20.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_m5.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_m10.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_m15.stl",
|
||||
// Slic3r::resources_dir() + "/calib/flowrate_m20.stl"
|
||||
// }, LoadStrategy::LoadModel | LoadStrategy::Silence);
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_0.stl" );
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_5.stl" );
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_15.stl" );
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_20.stl" );
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_m5.stl" );
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_m10.stl");
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_m15.stl");
|
||||
// //add_model(false, Slic3r::resources_dir() + "/calib/flowrate_m20.stl");
|
||||
//
|
||||
// }
|
||||
// wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
// CallAfter([this] {this->arrange(); });
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
ModelObject* Plater::add_part(ModelObject* model_object, std::string input_file, Vec3d move, Vec3d scale) {
|
||||
Model model;
|
||||
try {
|
||||
model = Model::read_from_file(input_file);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
auto msg = _L("Error!") + " " + input_file + " : " + e.what() + ".";
|
||||
show_error(this, msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (ModelObject* object : model.objects) {
|
||||
Vec3d delta = Vec3d::Zero();
|
||||
if (model_object->origin_translation != Vec3d::Zero())
|
||||
{
|
||||
object->center_around_origin();
|
||||
delta = model_object->origin_translation - object->origin_translation;
|
||||
}
|
||||
for (ModelVolume* volume : object->volumes) {
|
||||
volume->translate(delta + move);
|
||||
if (scale != Vec3d{ 1,1,1 }) {
|
||||
volume->scale(scale);
|
||||
}
|
||||
ModelVolume* new_volume = model_object->add_volume(*volume);
|
||||
new_volume->set_type(ModelVolumeType::MODEL_PART);
|
||||
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
||||
|
||||
//volumes_info.push_back(std::make_pair(from_u8(new_volume->name), new_volume->get_mesh_errors_count() > 0));
|
||||
|
||||
// set a default extruder value, since user can't add it manually
|
||||
// new_volume->config.set_key_value("extruder", new ConfigOptionInt(0));
|
||||
// new_volume->config.set_key_value("first_layer_extruder", new ConfigOptionInt(0));
|
||||
|
||||
//move to bed
|
||||
/* const TriangleMesh& hull = new_volume->get_convex_hull();
|
||||
float min_z = std::numeric_limits<float>::max();
|
||||
for (const stl_facet& facet : hull.stl.facet_start) {
|
||||
for (int i = 0; i < 3; ++i)
|
||||
min_z = std::min(min_z, Vec3f::UnitZ().dot(facet.vertex[i]));
|
||||
}
|
||||
volume->translate(Vec3d(0,0,-min_z));*/
|
||||
}
|
||||
}
|
||||
assert(model.objects.size() == 1);
|
||||
return model.objects.empty() ? nullptr : model.objects[0];
|
||||
}
|
||||
|
||||
void Plater::calib_flowrate(int pass) {
|
||||
if (pass != 1 && pass != 2)
|
||||
return;
|
||||
const auto calib_name = "Flowrate Test";
|
||||
new_project(false, false, calib_name);
|
||||
|
||||
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
float start = 80.0f;
|
||||
float delta = 10.f;
|
||||
if (pass == 1) {
|
||||
start = 80.0f;
|
||||
delta = 10.0f;
|
||||
}
|
||||
else {
|
||||
start = 92.0f;
|
||||
delta = 2.0f;
|
||||
}
|
||||
|
||||
std::vector<size_t> objs_idx = load_files(std::vector<std::string>{
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "filament_flow_test_cube.amf").string(),
|
||||
(boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "filament_flow_test_cube.amf").string()}, LoadStrategy::LoadModel | LoadStrategy::Silence);
|
||||
|
||||
|
||||
assert(objs_idx.size() == 5);
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto printerConfig = &wxGetApp().preset_bundle->printers.get_edited_preset().config;// get_tab(Preset::TYPE_PRINTER)->get_config();
|
||||
|
||||
/// --- scale ---
|
||||
// model is created for a 0.4 nozzle, scale xy with nozzle size.
|
||||
const ConfigOptionFloats* nozzle_diameter_config = printerConfig->option<ConfigOptionFloats>("nozzle_diameter");
|
||||
assert(nozzle_diameter_config->values.size() > 0);
|
||||
float nozzle_diameter = nozzle_diameter_config->values[0];
|
||||
float xyScale = nozzle_diameter / 0.4;
|
||||
//scale z to have 6 layers
|
||||
double first_layer_height = print_config->option<ConfigOptionFloat>("initial_layer_print_height")->value;
|
||||
double layer_height = nozzle_diameter / 2.;
|
||||
first_layer_height = std::max(first_layer_height, nozzle_diameter / 2.);
|
||||
|
||||
float zscale = first_layer_height + 5 * layer_height;
|
||||
//do scaling
|
||||
if (xyScale < 0.9 || 1.2 < xyScale) {
|
||||
for (size_t i = 0; i < 5; i++)
|
||||
model().objects[objs_idx[i]]->scale(xyScale, xyScale, zscale); // base: 10 10 1
|
||||
}
|
||||
else {
|
||||
for (size_t i = 0; i < 5; i++)
|
||||
model().objects[objs_idx[i]]->scale(1, 1, zscale);
|
||||
}
|
||||
|
||||
//add sub-part after scale
|
||||
float zscale_number = (first_layer_height + layer_height) / 0.4;
|
||||
/* zshift is calculated using the following:
|
||||
(zscale / 2) represents the midpoint of the filament_flow_test_cube
|
||||
((first_layer_height + layer_height) / 2) represents the midpoint of our indicator tab (it is scaled to be 2 layers tall)
|
||||
The 0.3 constant is the same as the delta calculated in add_part below, this should probably be calculated per the model object
|
||||
*/
|
||||
float zshift = -(zscale / 2) + ((first_layer_height + layer_height) / 2) + 0.3;
|
||||
if (pass == 1) {
|
||||
add_part(model().objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m20.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[1]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m10.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[2]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "_0.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[3]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "p10.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[4]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "p20.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
}
|
||||
else if (pass == 2) {
|
||||
add_part(model().objects[objs_idx[0]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m8.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[1]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m6.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[2]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m4.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[3]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "m2.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
add_part(model().objects[objs_idx[4]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "_0.amf").string(), Vec3d{ 10 * xyScale,0,zshift }, Vec3d{ xyScale , xyScale, zscale_number });
|
||||
}
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
add_part(model().objects[objs_idx[i]], (boost::filesystem::path(Slic3r::resources_dir()) / "calib" / "filament_flow" / "O.amf").string(), Vec3d{ 0,0,zscale / 2.f + 0.5 }, Vec3d{ xyScale , xyScale, layer_height / 0.2 }); // base: 0.2mm height
|
||||
}
|
||||
|
||||
/// --- translate ---;
|
||||
bool has_to_arrange = false;
|
||||
////const ConfigOptionFloat* extruder_clearance_radius = print_config->option<ConfigOptionFloat>("extruder_clearance_radius");
|
||||
//float extruder_clearance_radius = 0.0f;
|
||||
////const ConfigOptionPoints* bed_shape = printerConfig->option<ConfigOptionPoints>("printable_area");
|
||||
//auto bed_area = printerConfig->option<ConfigOptionPoints>("printable_area")->values;
|
||||
//const double brim_width = nozzle_diameter * 3.5;
|
||||
//Vec2d bed_size = BoundingBoxf(bed_area).size();
|
||||
//Vec2d bed_min = BoundingBoxf(bed_area).min;
|
||||
//float offsetx = 3 + 20 * xyScale + extruder_clearance_radius + brim_width + (brim_width > extruder_clearance_radius ? brim_width - extruder_clearance_radius : 0);
|
||||
//float offsety = 3 + 20 * xyScale + extruder_clearance_radius+ brim_width + (brim_width > extruder_clearance_radius ? brim_width - extruder_clearance_radius : 0);
|
||||
//model().objects[objs_idx[0]]->translate({ bed_min.x() + bed_size.x() / 2 - offsetx / 2, bed_min.y() + bed_size.y() / 2 - offsety, zscale / 2 });
|
||||
//model().objects[objs_idx[1]]->translate({ bed_min.x() + bed_size.x() / 2 - offsetx / 2, bed_min.y() + bed_size.y() / 2 , zscale / 2 });
|
||||
//model().objects[objs_idx[2]]->translate({ bed_min.x() + bed_size.x() / 2 - offsetx / 2, bed_min.y() + bed_size.y() / 2 + offsety, zscale / 2 });
|
||||
//model().objects[objs_idx[3]]->translate({ bed_min.x() + bed_size.x() / 2 + offsetx / 2, bed_min.y() + bed_size.y() / 2 - offsety, zscale / 2 });
|
||||
//model().objects[objs_idx[4]]->translate({ bed_min.x() + bed_size.x() / 2 + offsetx / 2, bed_min.y() + bed_size.y() / 2 + offsety, zscale / 2 });
|
||||
|
||||
/// --- custom config ---
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
|
||||
model().objects[objs_idx[i]]->config.set_key_value("wall_loops", new ConfigOptionInt(3));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("only_one_wall_top", new ConfigOptionBool(true));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("sparse_infill_density", new ConfigOptionPercent(40));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("bottom_shell_layers", new ConfigOptionInt(3));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("top_shell_layers", new ConfigOptionInt(4));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("detect_thin_wall", new ConfigOptionBool(true));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("filter_out_gap_fill", new ConfigOptionFloat(0));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("layer_height", new ConfigOptionFloat(layer_height));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("initial_layer_height", new ConfigOptionFloat(first_layer_height));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("sparse_infill_pattern", new ConfigOptionEnum<InfillPattern>(ipRectilinear));
|
||||
model().objects[objs_idx[i]]->config.set_key_value("top_surface_pattern", new ConfigOptionEnum<InfillPattern>(ipMonotonic));
|
||||
//disable ironing post-process
|
||||
model().objects[objs_idx[i]]->config.set_key_value("ironing_type", new ConfigOptionEnum<IroningType>(IroningType::NoIroning));
|
||||
//set extrusion mult: 80 90 100 110 120
|
||||
model().objects[objs_idx[i]]->config.set_key_value("print_flow_ratio", new ConfigOptionPercent(start + (float)i * delta));
|
||||
}
|
||||
|
||||
//update plater
|
||||
//GLCanvas3D::set_warning_freeze(false);
|
||||
//wxGetApp().get_tab(Preset::TYPE_PRINT)->load_config(new_print_config);
|
||||
//on_config_change(new_print_config);
|
||||
changed_objects(objs_idx);
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
//update everything, easier to code.
|
||||
//ObjectList* obj = wxGetApp().obj_list();
|
||||
//obj->update_after_undo_redo();
|
||||
// automatic selection of added objects
|
||||
if (!objs_idx.empty() && p->view3D != nullptr) {
|
||||
// update printable state for new volumes on canvas3D
|
||||
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_objects(objs_idx);
|
||||
|
||||
Selection& selection = p->view3D->get_canvas3d()->get_selection();
|
||||
selection.clear();
|
||||
for (size_t idx : objs_idx) {
|
||||
selection.add_object((unsigned int)idx, false);
|
||||
}
|
||||
|
||||
// BBS: update object list selection
|
||||
p->sidebar->obj_list()->update_selections();
|
||||
|
||||
if (p->view3D->get_canvas3d()->get_gizmos_manager().is_enabled())
|
||||
// this is required because the selected object changed and the flatten on face an sla support gizmos need to be updated accordingly
|
||||
p->view3D->get_canvas3d()->update_gizmos_on_off_state();
|
||||
}
|
||||
// arrange if needed, after new settings, to take them into account
|
||||
if (has_to_arrange) {
|
||||
//update print config (done at reslice but we need it here)
|
||||
if (printer_technology() == ptFFF)
|
||||
fff_print().apply(model(), *config());
|
||||
arrange();
|
||||
}
|
||||
|
||||
//reslice();
|
||||
|
||||
//if (autocenter) {
|
||||
// //re-enable auto-center after this calibration.
|
||||
// wxGetApp().app_config->set("autocenter", "1");
|
||||
//}
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
void Plater::import_sl1_archive()
|
||||
|
|
|
@ -227,6 +227,8 @@ public:
|
|||
|
||||
// SoftFever
|
||||
void calib_pa(bool bowden = false);
|
||||
void calib_flowrate(int pass);
|
||||
ModelObject* add_part(ModelObject* model_object, std::string input_file, Vec3d move, Vec3d scale);
|
||||
|
||||
//BBS: add only gcode mode
|
||||
bool only_gcode_mode() { return m_only_gcode; }
|
||||
|
|