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

Error using sa_row(1) key(); #207

Open
archonoff opened this issue Mar 25, 2024 · 3 comments
Open

Error using sa_row(1) key(); #207

archonoff opened this issue Mar 25, 2024 · 3 comments

Comments

@archonoff
Copy link

archonoff commented Mar 25, 2024

I'm currently learning how to use the KeyV2 project and have encountered some unexpected errors that I can't figure out.

For example, when I input sa_row(2) key(); into keys.scad and press F6, I successfully get the key rendered. However, changing it to sa_row(1) key(); results in the following error and no key is rendered:

ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion violation!
Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h
Line: 294

image

Interestingly, modifying the code to sa_row(1) 2u() key(); still results in errors:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!
Expr: e_below != SHalfedge_handle()
File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 418
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!
Expr: e_below != SHalfedge_handle()
File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_3/SNC_FM_decorator.h
Line: 418

However, in this case, the key is at least rendered.
image

Could anyone help me understand what I might be missing?

Additionally, here's another example that demonstrates a similar issue I'm facing.
I'm attempting to render keys with various profiles using the following code:

for (x = [0:1:4]) {
  translate_u(0,-x) oem_row(x) key();
}
for (x = [0:1:4]) {
  translate_u(1,-x) cherry_row(x) key();
}
for (x = [0:1:4]) {
  translate_u(2,-x) sa_row(x) key();
}
for (x = [0:1:4]) {
  translate_u(3,-x) dcs_row(x) key();
}
for (x = [0:1:4]) {
  translate_u(4,-x) mt3_row(x) key();
}

The result should display a series of keys with OEM, Cherry, SA, MT3, and DCS profiles. However, while the OEM, Cherry, and DCS profiles render as expected, only two keys for the SA profile are rendered correctly. And for the MT3 profile one key is missing and most of the rendered ones are floating above the ground plane.
image
image

This issue seems to specifically affect the SA and MT3 profiles rendering under certain conditions, similar to the previous error I mentioned. Could this be related, or is there another explanation?

I use OpenSCAD-2024.03.23 64bit on Windows 11

@archonoff archonoff changed the title Doesn't work simple sa_row(1) key(); Error using sa_row(1) key(); Mar 25, 2024
@cmandlbaur
Copy link

I was trying to get the SA profiles working and ran into the same issue.

What helped me was setting $hull_shape_type = "skin"; before generating any of the keys. Found the details in the TIPS_AND_TRICKS.md file.

@cmandlbaur
Copy link

Actually looks like that gets them to render, but geometry is deformed in the corners.

@cmandlbaur
Copy link

Did a bit of digging and found - openscad/openscad#4313

Last comment mentions using manifold fixes the error.

In preferences > features, enable manifold.

That seems to have solved it for me.

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