Skip to content
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

Add a tolerance parameter to 2dbitmap and 1dbitmap #5

Closed
wants to merge 1 commit into from
Closed

Add a tolerance parameter to 2dbitmap and 1dbitmap #5

wants to merge 1 commit into from

Conversation

dimo414
Copy link
Contributor

@dimo414 dimo414 commented Jul 18, 2021

Since the bits are coincident it can leave non-manifold artifacts in models.

Before:
coincident

After:
overlapping

@dimo414
Copy link
Contributor Author

dimo414 commented Apr 30, 2023

@X-Illuminati any interest in this PR?

@X-Illuminati
Copy link
Owner

@dimo414 ,
I see what you mean, and I had the same problem with the 2dbitmaps when creating the dogtag example. Initial attempts at a 3d-printable STL required a lot of cleanup in meshmixer, as I recall.
What I am seeing now is that I need 0.003 in order to avoid artifacts in the preview window. (Although, I would guess that 0.001 resolves the problem when a full render is performed.)

I had previously added an expansion parameter to the 2dbitmaps to resolve this. However, I never introduced any default expansion into the 1dbitmaps. I think I forgot to go back and make the changes.

Also, it looks like you and I took different approaches to solving the problem.
The "expansion" parameter I added is really a "pull-back" and is therefore misnamed.
Again, this was probably because of my focus on the 3d-printing use-case for the 2d barcodes - not only does it clean up the non-manifold edges, but you generally want to shrink things that are going to fit together as they will expand a bit when printed in plastic.
Example with expansion=.1:
image

In any case, what you have done makes sense for the 1dbitmaps - I will probably just implement it as a default "expansion" of -0.003, though. (Actually, I will probably change the logic so that expansion makes sense as a positive value instead.)

@X-Illuminati
Copy link
Owner

Commit 91bcd82 changes the name of the expansion parameter to "pullback" and adds it in as an option to the UPC and Code128 barcodes. The default is -0.003.

@dimo414 dimo414 deleted the patch-2 branch May 8, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants