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

Offsetting Bugs #61

Open
giannissc opened this issue May 19, 2023 · 3 comments
Open

Offsetting Bugs #61

giannissc opened this issue May 19, 2023 · 3 comments

Comments

@giannissc
Copy link
Contributor

giannissc commented May 19, 2023

Here is the original problem as I encountered it:

  • You start with a workplane and you create a shape.
  • You translate and rotate that shape.
  • You then create a subsequent shape from the previous workplane
  • If you execute offset2D on both of these solids you will get a correct offset for the first shape but the second will be offset and rotated by the original offset and rotation (see below)

image

If I apply my fix then everything goes back into the correct place:
image

The fundamental problem with my solution is that it depend on the centers not changing, which is not always the case. Some designs (see below) can create intersections when you create and an offset and those intersections need to be trimmed (hence changing the center of the wire).

image

When my fix is applied in the context of cq_cam then offsets that cause intersection and change the original shape will be moved into the previous center (see below).

image

There are however design that can still cause the issue with cq-cam:
image

So we need a robust way to detect when intersections happen and take that into account when correcting the offset.

@giannissc
Copy link
Contributor Author

I don't know if there is some correct way in cad query to create new shapes from previous ones that don't cause this behaviour or if this is indeed a bug with either cadquery or OCCT. Your feedback would be greatly appreciated! @voneiden

@voneiden
Copy link
Owner

  1. The first picture is definitely looks like the circle offset bug in OCCT/cadquery

  2. Instead of using your workaround, have you tried offsetting with the cq_cam.utils.geometry_op.offset_wire method to see if it yields a different result when generating the cq-cam toolpaths later?

  3. Could you export a BREP of the wire in the latter pictures? Would be interesting to test against it.

@giannissc
Copy link
Contributor Author

The first picture is definitely looks like the circle offset bug in OCCT/cadquery

I realized yesterday that this is actually what might be going on and I wanted to try to apply the circle offset bug patch instead of mine. I never actually thought of trying other shape combinations as that was the one I wanted to use in my designs. If that's the bug that I am encountering then I suspect that the two problematic images before want happen anymore!

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