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

Offset (Displacement Modifier) #83

Open
ralphgeorg-s opened this issue Feb 18, 2022 · 19 comments
Open

Offset (Displacement Modifier) #83

ralphgeorg-s opened this issue Feb 18, 2022 · 19 comments

Comments

@ralphgeorg-s
Copy link

the library is amazing. I would like to add a displacement - for example 0.5mm - so that the objects are not water-tight. Is there an option?

@nicklockwood
Copy link
Owner

I'm not sure I understand. What do you want to displace?

@ralphgeorg-s
Copy link
Author

In blender its called - overlap threshold
https://blender.stackexchange.com/questions/143741/boolean-difference-with-offset

@nicklockwood
Copy link
Owner

OK, I think I understand. This feature doesn't exist in Euclid currently, but isn't hard to add.

@ralphgeorg-s
Copy link
Author

Thx for your answer. Can you guide us on how to do this?

@nicklockwood
Copy link
Owner

@ralphgeorg-s I'll add the feature soon.

@ralphgeorg-s
Copy link
Author

that's amazing, thx.

@nicklockwood
Copy link
Owner

nicklockwood commented Feb 21, 2022

@ralphgeorg-s I've pushed the feature to the develop branch. Use it like this:

let smallerMesh = mesh.inset(by: 0.01)
let biggerMesh = mesh.inset(by: -0.01)

@nicklockwood
Copy link
Owner

@ralphgeorg-s actually it seems a little buggy for some meshes. I'll let you know when it's fixed.

@nicklockwood
Copy link
Owner

@ralphgeorg-s OK, it's working better now. There are still some issues with concave meshes, but that may not be an issue for you. Let me know if it solves your problem.

@ralphgeorg-s
Copy link
Author

Thx so much, we will test.

@ralphgeorg-s
Copy link
Author

@nicklockwood - we tried yesterday night - but it takes hours to calculate. We do have some complex files.

@nicklockwood
Copy link
Owner

@ralphgeorg-s OK, I'll do some work to optimize it. Can you send me a sample file I can use for testing?

@ralphgeorg-s
Copy link
Author

ralphgeorg-s commented Feb 22, 2022 via email

@nicklockwood
Copy link
Owner

@ralphgeorg-s I've improved the performance of Mesh.inset(by:) - it should now be near-instant.

@ralphgeorg-s
Copy link
Author

ralphgeorg-s commented Feb 24, 2022 via email

@nicklockwood
Copy link
Owner

@ralphgeorg-s the screenshots you shared didn't come through. Perhaps you can share some code I can use to reproduce the issue with the models you already provided?

Inset 0.05 means 50 microns?

Euclid uses abstract distance units, so it will be relative to whatever the original model scale was. If your original model scale is in mm then 0.05 will be 50 microns (unless you've applied a scale transform to the model after loading it).

@nicklockwood
Copy link
Owner

@ralphgeorg-s any update?

@ralphgeorg-s
Copy link
Author

Hi, not yet. when the offset is zero - then the boolean difference is perfect. I used a cube ad a pipe. When you set an offset the models break in pieces.

@ralphgeorg-s
Copy link
Author

ralphgeorg-s commented May 12, 2022

Screen Shot 2022-05-12 at 7 13 20 PM

Screen Shot 2022-05-12 at 7 14 03 PM

Screen Shot 2022-05-12 at 7 26 28 PM

when we add the Mesh.inset(by:) - the mesh is not clean somehow. the second screenshot is with inset zero - super clean,

do you have any ideas or advice? thx for your help. ralph

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

No branches or pull requests

2 participants