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

Code to be fixed. #37

Open
max-free opened this issue Sep 17, 2023 · 1 comment
Open

Code to be fixed. #37

max-free opened this issue Sep 17, 2023 · 1 comment

Comments

@max-free
Copy link

Hi, I may have found an issue which should be fixed.

When I used CGS.Substruct() for a couple of times, I found Node.polygons.Count had rapidly increased. This was actually caused by

List list = this.polygons;

in CGS/Classes/Node.cs line 171. Since when list changes, this.polygons also changes, the code above should be like

List list = new List(this.polygons);

Sorry if this is just my misunderstanding.

@Golgovskiy
Copy link

Have run this:

// Initial subtraction
Model initialResult = CSG.Subtract(lhs, rhs);
int polygonCount = 0;
// Perform Subtract operation multiple times
for (int i = 0; i < 10; i++)
{
    initialResult = CSG.Subtract(lhs, rhs);

    // Check Node polygons count
    Node node = new Node(initialResult.ToPolygons());
    polygonCount = node.AllPolygons().Count; // or just .polygons
    Debug.Log($"Iteration {i}: Polygon count = {polygonCount}");
}

piece of code, count does not change. Is it really a problem or am i missing the point?

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