constfloatgravity_constant=9806.65f;// mm/s^2; gravity acceleration on Earth's surface, algorithm assumes that printer is in upwards position.
constdoublefilament_density=1.25e-3f;// g/mm^3 ; Common filaments are very lightweight, so precise number is not that important
constdoublematerial_yield_strength=33.0f*1e6f;// (g*mm/s^2)/mm^2; 33 MPa is yield strength of ABS, which has the lowest yield strength from common materials.
constfloatstandard_extruder_conflict_force=10.0f*gravity_constant;// force that can occasionally push the model due to various factors (filament leaks, small curling, ... );
constfloatmalformations_additive_conflict_extruder_force=65.0f*gravity_constant;// for areas with possible high layered curled filaments
// MPa * 1e^6 = (g*mm/s^2)/mm^2 = g/(mm*s^2); yield strength of the bed surface
}else{//PLA default value - defensive approach, PLA has quite low adhesion
return0.02*1e6;
}
}
doubleget_support_spots_adhesion_strength()const{
return0.016f*1e6;
}
};
enumclassSupportPointCause{
LongBridge,// point generated on bridge and straight perimeter extrusion longer than the allowed length
FloatingBridgeAnchor,// point generated on unsupported bridge endpoint
FloatingExtrusion,// point generated on extrusion that does not hold on its own
SeparationFromBed,// point generated for object parts that are connected to the bed, but the area is too small and there is a risk of separation (brim may help)
UnstableFloatingPart,// point generated for object parts not connected to the bed, holded only by the other support points (brim will not help here)
WeakObjectPart// point generated when some part of the object is too weak to hold the upper part and may break (imagine hourglass)
};
// The support points can be sorted into two groups
// 1. Local extrusion support for extrusions that are printed in the air and would not
// withstand on their own (too long bridges, sharp turns in large overhang, concave bridge holes, etc.)
// These points have negative force (-EPSILON) and Vec2f::Zero() direction
// The algorithm still expects that these points will be supported and accounts for them in the global stability check.
// 2. Global stability support points are generated at each spot, where the algorithm detects that extruding the current line
// may cause separation of the object part from the bed and/or its support spots or crack in the weak connection of the object parts.
// The generated point's direction is the estimated falling direction of the object part, and the force is equal to te difference
// between forces that destabilize the object (extruder conflicts with curled filament, weight if instable center of mass, bed movements etc)
// and forces that stabilize the object (bed adhesion, other support spots adhesion, weight if stable center of mass).
// Note that the force is only the difference - the amount needed to stabilize the object again.