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

scs_bearing_blocks preview looks correct, but render is not complete #292

Open
tpimh opened this issue Oct 17, 2024 · 6 comments
Open

scs_bearing_blocks preview looks correct, but render is not complete #292

tpimh opened this issue Oct 17, 2024 · 6 comments

Comments

@tpimh
Copy link

tpimh commented Oct 17, 2024

I am using OpenSCAD 2024.10.15.ai20955 (git 335ed8eb2), but this can also be reproduced with earlier versions.

In order to reproduce, add any scs_bearing_block to your project and comment out if ($preview) line.

For some reason, only the bearing is rendered, but not the other parts of the bearing block.

This is how preview (F5) looks:
Screenshot from 2024-10-17 09-52-55

This is how render (F6) looks:
Screenshot from 2024-10-17 09-53-52

I expect the two to look identical (like sbr_bearing_block does). Not sure why the rendering only works partially.

@nophead
Copy link
Owner

nophead commented Oct 17, 2024

None of the vitamins and designed to be rendered with F6. They are only for making assembly views with F5. F6 is used to make STLs for printing and DXfs for routing. In general vitamins are not manifold so CGAL would barf at them and there are no colours with CGAL so it would be pointless.

I am aware recent versions of OpenSCAD can show colours with manifold but I haven't run a version that new. It would be a lot of work to make the vitamins renderable and I am not sure what is allowed with manifold that isn't with CGAL. CGAL only accepts manifolds and is very strict. Manifold, despite the name, seems less strict at accepting and creating manifolds.

@tpimh
Copy link
Author

tpimh commented Oct 17, 2024

Yes, I am currently rendering with Manifold backend (hence the color in F6 render). One of the recent developments in OpenSCAD is the PovRay export: openscad/openscad#5288. The author of the export intends to export the viewport information into the PovRay file, so the result would look similar to OpenSCAD PNG export.

For NopSCADlib it can mean that povray can possibly replace magick. The process would be "OpenSCAD export POV" -> "PovRay" (instead of "OpenSCAD export PNG" -> "ImageMagick"), would take some much time, but would look nicer. This is all only theoretical at the moment, I've got no code to show, because the only way to get the correct viewport in such export at the moment is patching the exported file. Not impossible, but I would better just wait for the updated export containing the viewport information.

@nophead
Copy link
Owner

nophead commented Oct 17, 2024

Yes the problem is OpenSCAD has been around for about 14 years and has only supported colour in the last few months, so this library never anticipated the change. Also the latest versions of OpenSCAD don't support my use of $variables so I have to use the last release to build my objects.

I have no idea how much work it would be to make the vitamins render with F6.

@tpimh
Copy link
Author

tpimh commented Oct 18, 2024

Here's a simple spinning animation of Enviro+ that I made for demonstration of PovRay. Looks like nothing is missing.

EnviroPlus.mp4

@nophead
Copy link
Owner

nophead commented Oct 18, 2024

The colours aren't correct though.
image

As I don't understand what Manifold's rules are I have no idea what will work and what won't. CGAL doesn't like assembly views because things touch without overlapping, etc. If you want to debug all the vitamins and post a PR then that is OK with me as long as the assembly views with F5 don't change or slow down.

@nophead
Copy link
Owner

nophead commented Oct 20, 2024

Also I think we would still need ImageMagick to compare the images to check for differences and show them, etc. It is also used to get the correct size because OpenSCAD's viewall is too small in most cases. I think it scales the bounding sphere to the vertical size of the window. With ImageMagick I crop it to the to the object's pixels and then scale it and add a border. So unless povray can auto zoom getting OpenSCADs viewport isn't sufficient.

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