You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slicing Unity's sphere results in meshes with uncovered holes #36
Slicing a sphere created with Unity's right click>3D Object>Sphere, with identity transform with planeWorldPosition = Vector3.zero and planeWorldDirection = Vector3.right results in hemisphere meshes with holes.
When I rotate the sphere 5 degrees along the y axis, it doesn't happen.
This happens in master at commit b93d68c Unity Version 2019.3.5f1 (d691e07d38ef) Personal
This doesn't happen on release 1.0.0
Script used for slicing:
using EzySlice;
using UnityEngine;
public class SliceOnClick : MonoBehaviour
{
public Material innerMaterial;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnMouseDown()
{
Debug.Log("CUTTING");
if (this.Slice(Vector3.zero, Vector3.right) == null)
{
Debug.Log("FAILED");
}
Debug.Log("WORKED");
}
public GameObject[] Slice(Vector3 planeWorldPosition, Vector3 planeWorldDirection)
{
return this.gameObject.SliceInstantiate(planeWorldPosition, planeWorldDirection, CalculateCustomRegion(0, 0, 512, 512), this.innerMaterial);
}
public TextureRegion CalculateCustomRegion(int px, int py, int width, int height)
{
return this.innerMaterial.GetTextureRegion(px, py, width, height);
}
}
I also have this problem, it doesn't happen with threading branch. Check the List<Vector3> intPoints and with the same model, the master branch has a count of 0. It mainly happens with complex geometry.
It may also be processing well, but you have forgotten to place a material. That is, not even this slot is available in the MeshRenderer, only 1, (the visible material).
Hey, guys.
I also have the same problem and i found the reason, why this happens. @DavidArayan, Maybe it will help you fix them.
This happens, when cutting plane exactly crosses one or more vertexes of a mesh.
For example, i have a fruit cutting game, and i replaced my mesh with unity standard primitive cube. I turned my cube mesh to 45 degrees and set cutting plane position exactly in the middle of a cube just like on screenshot.
And i sliced this.
UP: i use last framework version with my Unity 2020.3.1f1
UP2: We love your framework so much, David.
This happens when one of the vertices is exactly on the plane. I faced the same issue and fixed it by changing the logic a little bit. When first vertice is on the plane, check second and third vertice as well to make the right decision
EzySlice/Slicer.cs
Activity
DavidArayan commentedon May 19, 2020
Thank you for the bug report and extensive information! I will investigate to see whats going on.
pruebasssaa commentedon May 28, 2020
I also have this problem, it doesn't happen with threading branch. Check the
List<Vector3> intPointsand with the same model, the master branch has a count of 0. It mainly happens with complex geometry.It may also be processing well, but you have forgotten to place a material. That is, not even this slot is available in the MeshRenderer, only 1, (the visible material).
PurpleSlayerFish commentedon Feb 21, 2022
Hey, guys.
I also have the same problem and i found the reason, why this happens.
@DavidArayan, Maybe it will help you fix them.
This happens, when cutting plane exactly crosses one or more vertexes of a mesh.
For example, i have a fruit cutting game, and i replaced my mesh with unity standard primitive cube. I turned my cube mesh to 45 degrees and set cutting plane position exactly in the middle of a cube just like on screenshot.
And i sliced this.
UP: i use last framework version with my Unity 2020.3.1f1




UP2: We love your framework so much, David.
michail-p commentedon Jul 6, 2023
anyone fixed this?
XaHDpE commentedon May 14, 2024
Anybody?)
evgenykralko commentedon Mar 14, 2025
This happens when one of the vertices is exactly on the plane. I faced the same issue and fixed it by changing the logic a little bit. When first vertice is on the plane, check second and third vertice as well to make the right decision

EzySlice/Slicer.cs