-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for structured noise (perlin) fuzzy skin #7678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@Arachnid I hope you don't mind: Here are some suggestions you might consider:
p.s. |
I'm happy to consider it! I'd like to hear from the maintainers before renaming existing features, though - there may be concerns about confusion / backwards compatibility.
Already done!
This is tricky. The existing noise library generates 3 dimensional noise, meaning we can get the value for any point just by querying it. Mapping a 2d object like an SVG to a surface is much more complex, and I'm afraid it's beyond my basic computational geometry skills! |
Fixes #7467 |
Is it possible to add the libnoise as an external dep that can be downloaded as a zip during build? |
As far as I can tell, libnoise is only hosted on source forge, which has a browser interstitial for all downloads. I can try and bypass it for an automated download, but I was concerned that would be subject to breakage easily. I can also delete irrelevant files such as docs, if that would help. |
Absolutely. Now my browser freezes as soon as I switch to the Files Changed tab |
@Noisyfox This is what I suggest to change in 2348 optgroup->append_single_option_line("fuzzy_skin");
2349 optgroup->append_single_option_line("fuzzy_skin_noise_type");
2350 optgroup->append_single_option_line("fuzzy_skin_point_distance");
2351 optgroup->append_single_option_line("fuzzy_skin_thickness");
2352 optgroup->append_single_option_line("fuzzy_skin_scale");
2353 optgroup->append_single_option_line("fuzzy_skin_octaves");
2354 optgroup->append_single_option_line("fuzzy_skin_persistence");
2355 optgroup->append_single_option_line("fuzzy_skin_first_layer");
Optionally line @Arachnid |
I've reordered the options as suggested by @discip. I've also fixed the image - good catch. I've also removed the docs folder to cut down on the number of files imported. Still happy to restructure it to download it at build time, if we have a good solution to the sourceforge hosting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! 👍
Thank you!
I've been playing with this for about a week now and its super cool! i was wondering however if it would be possible to add the option to apply fuzzy skin to the top layer? i know it's technically possible with https://github.com/TengerTechnologies/Fuzzyficator, but having it as an actual feature would be awesome! |
Adding fuzzy skin to top surfaces is a whole different thing! I'd love to have it too, but I think it will require a separate pr reimplementing their hard work in C++. |
@SoftFever Appreciate you have a lot going on, but I'd hugely appreciate it if you're able to give this a review. |
src/libslic3r/PerimeterGenerator.cpp
Outdated
} else { | ||
const auto current_ext = extrusion.junctions; | ||
std::vector<Arachne::ExtrusionJunction> segment; | ||
segment.reserve(current_ext.size()); | ||
extrusion.junctions.clear(); | ||
|
||
const auto fuzzy_current_segment = [&segment, &extrusion, &r]() { | ||
const auto fuzzy_current_segment = [&segment, extrusion, &r, slice_z]() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a compile error here: because extrusion
should IMHO be captured by reference like before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed. I accidentally removed it when merging changes.
Very impressive results 💯 |
Good catch. I left it in because I didn't want to break legacy fuzzy skin, and leaving it as-is reduced the size of the diff, while not making a meaningful difference to the results with random noise. I can see how it would affect something more deterministic though! |
@Arachnid Can we move the libnoise to third-party library (deps) so that we don't have to build it every time? |
@SoftFever Glad you like it! I'm happy to change how it's built, but I could use some advice on how. When I was looking at the process originally it looked like libraries in deps had to be downloaded as part of the build process, and the only download source for this library is sourceforge, with an interstitial page. |
We can create a repo just like what we did for nanosvg and wxwidget. |
@Arachnid Another option is that I can create another PR |
Amazing, thank you! Allow edits by maintainers is already ticked, so you should be able to push to my branch. |
Hmm I still can't push |
Move libnoise to deps
Merged! |
There are some compiler error after merging with main branch. Thank you very much! |
Amazing. Thank you so much! |
def->set_default_value(new ConfigOptionFloat(1.0)); | ||
|
||
def = this->add("fuzzy_skin_octaves", coInt); | ||
def->label = L("Fuzzy Skin Noise Octaves"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arachnid
Hi. Skin has an uppercase S here, lower elsewhere.
@Arachnid Can I recommend that the settings be moved to "Quality" , with it's own "Fuzzy skin" group and icon? |
@henrivdr I think that makes a lot of sense. Happy to open a PR if @SoftFever agrees! |
Makes sense to have this as a separate group of settings now, from a usability perspective :) Under ironing may be a good place to create a new section as ironing is already collapsed if not used and fuzzy skin would be equally collapsed. |
That's a good suggestion to move it to its own group!
|
Makes sense :) |
Absolutely agree! |
* Add support for perlin noise fuzzy skin * Support multiple types of coherent noise * Updated tooltips for more clarity. * Reorder options as suggested by @discip * Fix accidental removal of & * Move libnoise to deps --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
Description
Fixes #7467.
The existing fuzzy skin support does a good job of hiding printing artefacts, but uses a very naive algorithm based on randomly displacing points on the outside wall of an object. This means that there's no correlation between the displacements of vertically adjacent points, and this in turn gives the fuzzy skin a characteristic horizontal pattern that can accentuate rather than hide layer lines.
This PR adds libnoise, a library for creating structured noise, and uses it to enhance the fuzzy skin functionality with new options that have better aesthetics compared to the existing uniform random noise. Several noise algorithms are supported:
A number of parameters are provided to affect the output:
Existing parameters - depth and point distance - continue to be used in the expected manner.
Backwards-compatibility is provided for by having 'classic' as the default noise type when fuzzy skin is enabled.
I've included the library inline following the example of some other libraries used by Orca, as it's only available via download from Sourceforge via an interstitial. If there's a better way to do this, please let me know.
Screenshots/Recordings/Graphs
Bambulab Calibration Cube by prdak27.
0.2mm point distance, 0.2mm thickness.
0.2mm point distance, 0.2mm thickness.
Fuzzy Love Teddy Bear by SamActivity
Classic: 0.8mm point distance, 0.3mm thickness.
Voronoi: 0.2mm point distance, 0.2mm thickness, 5mm feature size
All others: 0.2mm point distance, 0.3mm thickness, 3mm feature size, 5 octaves, 0.66 persistence