Incorrect plane slice with non uniform scale
See original GitHub issueIf the object is not scaled in a uniform way (e.g scaleX, scaleY, and scaleZ are different) then the slicing is not correct.
How to reproduce:
- Open
SliceDebugScene
from https://github.com/DavidArayan/EzySlice-Example-Scenes - Change scale of
ObjectToSlice
in the editor from(10, 10, 10)
to(10, 50, 10)
for example - Set the
SlicerPlane
field and clickCut Object
- Inspect the resulting objects (
Lower_Hull
andUpper_Hull
)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Non-Uniform Scaling during UV unwrap. What is this?
1 Answer. It's because your object has been scaled on some axes more than others in object mode. It should be fine, but...
Read more >Fix "Object has non-uniform scale, sculpting may be ...
An easier fix for that issue, is in Object Mode, press Ctrl+A and and choose Scale (the equivalent of using Object>Apply>Scale). Upvote 9...
Read more >UV Unwrap in Blender - How to Fix the Non-Uniform Error ...
In this demo, I show my class how to fix objects that unwrap badlyand throw the " Non -Unifor" error. This simple fix...
Read more >Scaling along an arbitrary axis (Dealing with non-uniform ...
The problem happens whenever I try to rotate this scaled box. The shape itself becomes distorted and it appears as though the Scale...
Read more >FPS drops when scale object. How fix? Unity Android
The problem may be due to the fact that more pixels is rendered (fragment shader is executed for every one) when the object...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In order to solve this issue the cut will need to happen in world space. This means transforming all vertices into world space, performing the cut operation and transforming the resulting points back into object space. This results in a fairly heavy computation cost so instead of “fixing” the current method, i’d probably add in an option to slice non uniform scaled objects separately at the cost of additional computation/time.
My apologies for not communicating this sooner. At the moment i’m slowly investigating moving the slicer into Unity Job System that would allow slices to be performing drastically faster. The new redesign would allow me to fix lingering issues such as these much easier.
Hello,
As of the latest commit b98da2a this issue should be resolved and can finally be closed. I’ve modified the SlicerExtensions.cs code so the Plane direction vector is properly transformed into the object local space before slicing.
Unfortunately this also means that the old method of using Transform.InverseTransformDirection or Transform.InverseTransformVector are incorrect. Unity should be using the Transpose Inverse Matrix to transform direction vectors for correct results. Maybe this is something that can be brought up with the Unity3D engineering team directly as a bug report. As a work around, i’m transposing and inverting the matrix manually for the correct results.
I will now close this issue. Thanks everyone!
Edit: See correct results after cutting a non-uniformly scaled object from following screenshot.