-
Notifications
You must be signed in to change notification settings - Fork 511
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
Helix difference extrusion yeilds staircase effect #489
Comments
There is no attached model. |
model.zip |
My suspicion on this is the piece-wise edge down the middle of the helix is a good fit for the actual edge - they're both straight. That edge needs to be broken into more sections due to the twist of the surface, but twist is not taken into account by the chord tolerance setting. If you use the icon at the top of the text window to display the mesh this issue is present even with regular NURBS rendering. It's probably less visible because the triangles are not flat-shaded in that mode. |
With current master the NURBS booleans actually work better than the triangle mesh ones for this particular model. This is a first :-) |
Is there issue thread on this rendering issue? |
It seems related to #379. These are not "solid edges" but they are edges of the triangular approximation of the surface. Seems like a tricky problem because those are supposed to show when one triangle is back facing and the other is front facing - that's probably how they show an "edge" around something like a torus even though there is no hard edge like on a cube. Twisted surfaces probably complicate that in ways that were never fully considered. It might also get better when the stair step issue here is resolved, as this one will require a better triangle mesh to fix. |
Yup, that's correct. In fact, you can see a similar issue with a torus, though it has far fewer artifacts: |
I assume @Evil-Spirit wrote the shader code. What lighting / surface shading model is used? We can turn off the white edge lines via toolbar button but the resulting rendering doesn't really show edges well. |
No, this acually change geometry of surface because 4 vertices not lay in the same plane. |
@ruevs actually your before image is considered "better" because the smallest angle in each triangle is larger ;-) But yeah, there are 2 ways to split a twisted quad. You can see in a torus there may be rings of quads split the other way. That's because the perimeter of each surface patch is triangulated with the generic method and not the quad-grid in my recent performance patch. Sometimes the perimeter does the diagonals the other direction. @Evil-Spirit Theoretically only the last normalization is needed there. Also, I was wondering about the lighting model for the surfaces. It looks like there are 2 light sources (upper left, lower right) and just ambient (constant) + perfect diffuse lighting. Is that correct? There are some better lighting models that are only a little more complicated and would look good when the white edges are turned off. |
JFTR, If in the future SolveSpace would get another lightning mode, could you keep "old lightning mode" (actual 2-sources lightning) as an option, please? Actual lightning is really cool if play with those preferences. |
I understand i changes the geometry, but in most cases (on "smooth" curved surfaces) it is mostly "cosmetic". What I meant to say is that it can not help with this particular problem. |
Practically you will get a problem when computing it in floating point mode for some kind of triangles. So, 3x normalization gives more precision (so hacky but works) |
Not for 3d modelliing / 3d printing. If you are common with creating 3d models in e.g. 3d max, maya, blender, etc, you can know what turning edges can improve model quality. For the current case we can also improve quality of blueprints (export 2d to dxf/pdf etc). It is because silhouette can be changed by "turning edges". |
I would think so. There is also Issue #524 asking for flat-color rendering. Designers can be very particular about changes to how parts are shown, I think taking away the current shading for something subjectively "better" would not be a good idea :-) |
Ah, there are two cases - bug from @phkahler and visual artifacts. I am talking about visual |
Sounds good to me! |
The mesh on the cylinder at the bottom looks awful. |
It's still an improvement on the current state, right? |
For the center axis of the helix - yes. The question is whether the degradation in other places is OK. |
@whitequark the helix is better, but like @ruevs said... The mesh down there is actually fine geometrically, it's just more thin triangles than needed because the grid is used. I did this by passing an optional flag down the MakePwlInto functions to indicate a curve is "twisted" which then invoked the "minimum 4 segments" thing I changed for circles. Now I'm thinking a better way would be to pass an optional "maximum dT" value that would force recursion until segments are less than that. That would be similar to how the minimum of 4 is done, but might allow helixes to specify shorter segments on the axis rather than just a flag to say "4". Still experimenting. Thanks for the quick feedback. |
…4 segments and forcing grid triangulation to use a minimum of 4x4 quads. This helps with issue solvespace#489.
OK then I pushed it to my "better_helix" branch. |
@ruevs without that change, just 4 segment edges NURBS: Using the grid forces all the ugly stuff to the center strip where it also seems to behave better - making nicer fans to cover the differing segment counts. The grid also limits the length of the silhouette edges. BTW I'm not entirely certain this creates a valid shell. I think the idea that helixing around a sketch line might be invalid came up in the original helix discussion. I managed to get it to do something kind of reasonable because it has to work for revolves. The edge on-axis does not create a surface in this case because it would be completely degenerate (zero area) so what is actually stitched together along the axis? I don't remember. It made my brain hurt to think about it. |
Updated my branch to allow max_dt for pwl segments. This is cleaner code but doesn't really help. Some things I remembered / concluded:
No conclusion yet. Edit: to clarify #1 about trim curves, they are geometrically correct but the connectivity - which surfaces share edges or even which span of an edge - varies depending on a lot of things and in general doesn't work as coded. |
…4 segments and forcing grid triangulation to use a minimum of 4x4 quads. This helps with issue solvespace#489. Also add a max_dt parameter for PWL creation and use that for helical edges. comments and moved code
…4 segments and forcing grid triangulation to use a minimum of 4x4 quads. This helps with issue solvespace#489. Also add a max_dt parameter for PWL creation and use that for helical edges.
Force helix axis line to 8 segments. Forcing grid triangulation to use a minimum of 4 segment for degree>1. This helps with issue solvespace#489. Added a max_dt parameter for PWL creation and use that for helical edges.
I think I got it now. PR #643 will fix the stair steps without affecting the other surfaces. I've got the center axis broken into more pieces and dynamic grid subdivision based on the twist of the surface. The Auger6 model is shown here with a chord tolerance of 0.2: The radial edges on top (the Pac-Man) are rough but that's a different problem and does not happen with NURBS. The isues with NURBS edges along the axis remain but can be eliminated by drawing the Pac-Man and doing a helix with an axis perpendicular to the sketch plane. The core issue here - the stair steps - has been much reduced. |
Resolve issue solvespace#489 helix has stairsteps. Force helix axis line to 8 segments. Grid triangulation to use a minimum of 4 segments for degree>1. Adds twist dependence for grid triangulation with degree=1. Added a max_dt parameter for PWL creation and use that for helical edges.
@Symbian9 and @Evil-Spirit The fix for this issue is also going to eliminate most of the false silhouette edges on these surfaces. It should be merged soon and will close this issue. |
Resolve issue #489 helix has stairsteps. Force helix axis line to 8 segments. Grid triangulation to use a minimum of 4 segments for degree>1. Adds twist dependence for grid triangulation with degree=1. Added a max_dt parameter for PWL creation and use that for helical edges.
Resolve issue solvespace#489 helix has stairsteps. Force helix axis line to 8 segments. Grid triangulation to use a minimum of 4 segments for degree>1. Adds twist dependence for grid triangulation with degree=1. Added a max_dt parameter for PWL creation and use that for helical edges.
System information
SolveSpace version: 3.0-7f9117b2bf0
Operating system: Fedora
Expected behavior
When selecting "force NURBS surfaces to triangle mesh" for a helix extrusion I though "chord tolerance" in the configuration menu would somehow influence the size of the triangles since it makes cylinders etc smoother.
Actual behavior
The slope of the helix in the attached model is very coarse, almost a staircase. In this model I have lowered the tolerance to 0.05% to no avail.
Additional information
If there is a way to control this, it should perhaps be more prominently positioned.
The text was updated successfully, but these errors were encountered: