Brep.Repair() running forever

Hi,

I have brep that will not pass running Brep.Repair()
To replicate run the below python script on the attached file.

import rhinoscriptsyntax as rs
id = rs.AllObjects()[0]
brep = rs.coercebrep(id)
brep.Repair(0.01)

no_repair_plate.3dm (90.4 KB)

EDIT: tracked this down a single face
no_repair_face.3dm (52.9 KB)

Any clues on what’s happening?

Thanks
-Willem

Hi @Willem,

How was the Brep created? I notice the model has no units.

– Dale

Hi Dale,

The Brep came in from an imported 3dm we got from a client.
I exported a ‘geometry only’ hence the lack of units.
Below is the part in the context of the original file.
Note that I had the faces shranked on the previous file.
This is the original with unshranked faces

no_repair_context.3dm (208.5 KB)

HTH
-Willem

Hi Willem,
The big plate surfaces are not planar. These are cylindrical with 1km radius. I assume this is causing the problems.
Jess

Hi Jess,

Thanks for the reply, the large radius was my suspect as well. That’s why I shrank the faces initially but that did not fix the Repair from failing to finish in a reasonable time.
There seems to be an issue with (remaining) trims because an edges rebuild made Repair finish.
Still I think Repair failing to finish can be considered a bug or shortcoming and is best fixed.

-Willem

Sure! Any unexpected behavior is a bug. Reparameterize also fixes the problem and makes your script work. So maybe this should be part of the Repair method.

Thanks for that pointer!!!
I’ll see if I can incorporate that in my code before the Repair.
It will at least keep some input from failing.

-Willem

It’s on the bug list https://mcneel.myjetbrains.com/youtrack/issue/RH-63085

Sorry to revive this topic, but got another case of forever repair mode that might be helpful! Starts off from this discussion on the spock-le forum.

The culprit was the seemingly innocent geometry being quite far off from origin. There’s a linked file in there that you can test with, otherwise lmk and i could try to come up with an isolated one.

For reference, happening in Rhino Version 7 SR29 (7.29.23107.3001, 2023-04-17). Didn’t test in WIPs.

Hi @idid,

Thanks, I’ve updated the issue.

Since none of Breps in the model are invalid, why call Brep.Repair?

Nice to hear from you.

– Dale

Hi Dale.

Not OP but answering the question from our perspective to give some insight:

Beep.Repair() is part of the “sanitation process” of imported geometries.

I assumed Repair() to help cleanup inconstancies and not doing harm for valid geometries.

Your questioning might indicate otherwise?

Thanks
-Willem

Happy to be around! I miss typing bugs in .NET/c# for rhino :slight_smile:

We might be over using it. It’s paranoia driven mostly, and we did raise an internal ticket to review our usage of it. Both Alan and me don’t remember why we put it there in the first place :slight_smile:

Exactly :sweat_smile: