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

brim ears #4691

Merged
merged 4 commits into from Jan 11, 2019

Conversation

Projects
None yet
5 participants
@supermerill
Copy link
Collaborator

supermerill commented Jan 10, 2019

#4687

  • add brim_ears setting: bool: set to true to activate this new funtino
  • add brim_ears_max_angle : float : max angle for a corner to be assigned a brim ear.
supermerill
brim ears
 - add brim_ears setting: bool: set to true to activate this new funtino
 - add brim_ears_max_angle : float : max angle for a corner to be assigned a brim ear.
@lordofhyphens

This comment has been minimized.

Copy link
Member

lordofhyphens commented Jan 10, 2019

Any thoughts on how to test this?

@VanessaE

This comment has been minimized.

Copy link
Collaborator

VanessaE commented Jan 10, 2019

Seems to me that the best way is to actually print something that's normally guaranteed to curl off of the bed, in ABS on untreated glass, playing with the brim settings to see the effect

@lordofhyphens

This comment has been minimized.

Copy link
Member

lordofhyphens commented Jan 10, 2019

@VanessaE I mean for the code generation.

Maybe inspecting the data structures?

@AppVeyorBot

This comment has been minimized.

Copy link

AppVeyorBot commented Jan 10, 2019

@VanessaE

This comment has been minimized.

Copy link
Collaborator

VanessaE commented Jan 10, 2019

You got me.......

supermerill
@supermerill

This comment has been minimized.

Copy link
Collaborator Author

supermerill commented Jan 10, 2019

I forgot: you should check the tooltips & text. I'm not a good english speaker.

@AppVeyorBot

This comment has been minimized.

Copy link

AppVeyorBot commented Jan 10, 2019

lordofhyphens added some commits Jan 11, 2019

@lordofhyphens lordofhyphens added this to the 1.3.1 milestone Jan 11, 2019

@lordofhyphens lordofhyphens merged commit 3b338e5 into slic3r:master Jan 11, 2019

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
//create ear pattern
coord_t size_ear = (scale_(this->config.brim_width.value) - flow.scaled_spacing());
Polygon point_round;
point_round.points.push_back(Point(size_ear*1, 0*size_ear));

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

This can be replaced with array of x,y coefficients ...
Also maybe angle + sin/cos may be used to generate the ear?

This comment has been minimized.

@supermerill

supermerill Jan 11, 2019

Author Collaborator

yes. I used that because it's quick and easy to write & test. Also we don't need a big precision and this number of point is enough. Too much and the intersection takes ages.

What code do you propose?

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

something like (untested):

for (int i = 0; i < POLY_SIDES; i++) {
  float angle = 2 * PI / POLY_SIDES * i;
   point_round.points.push_back(Point(size_ear * cos(angle), size_ear * sin(angle));
}
lines.erase(lines.begin() + best_idx);

//connect if near enough
if (lines_sorted.size() > 1) {

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

this is always true

This comment has been minimized.

@supermerill

supermerill Jan 11, 2019

Author Collaborator

Also, with some more tough, the if (previous == NULL) block should be put before the while.

//connect if near enough
if (lines_sorted.size() > 1) {
size_t idx = lines_sorted.size() - 2;
bool connect = false;

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

it is possible to check best_dist first and skip testing distance again.

This comment has been minimized.

@supermerill

supermerill Jan 11, 2019

Author Collaborator

?

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

Closest distance between lines is already available in best_dist

This comment has been minimized.

@supermerill

supermerill Jan 11, 2019

Author Collaborator

but i need to know where to do reverse(). So i need to store more information than just best_dist...

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

Yes, the tests will be necessary. But testing best_dist can skip the tests altogether.
It's just minor optimization ...

This comment has been minimized.

@supermerill

supermerill Jan 11, 2019

Author Collaborator

oh, i understand

double best_dist = -1;
size_t best_idx = 0;
while (lines.size() > 0) {
if (previous == NULL) {

This comment has been minimized.

@ledvinap

ledvinap Jan 11, 2019

Collaborator

(this can be moved before while, reducing nesting)

@supermerill supermerill referenced this pull request Jan 11, 2019

Merged

doc for brim_ears #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment