Trim with BREP inconsistent output

Im having trouble with a trim with brep, it is outputting some weird lines, It should completely separate inner lines and outer ones and it is not, do anyone have an idea what might be causing this?
The brep is a closed brep

TITERES 5 BREP TRIM.gh (23.1 KB)

Indeed strange results occur (tolerance? Karma? who knows?).

Get something that cuts the mustard properly :

Trim_issue_UC1_V1.gh (29.0 KB)

BTW: You need some more realistic stuff (var heights for visibility [study IAAF/local building regulations as well] ) for this. Like:

thank you for your excelent response, @PeterFotiadis
I must admit the complexity of the seatings in your images kinda scared me at first but as fellow grasshopper novice we must always strive for perfection and you sir are pointing me in the right direction, I will look into that, there will be probably some pre made scripts for that I assume

Well … always try to handle your things up to nut and bolt level: meaning (at least for this occasion) deal with the problem 100%. That said I’m not aware of any “pre-made” scripts that do that kind of stuff (and are available to public).

Some hints:

  1. Stadium design is strictly regulated by rules (IAAF, UEFA and local regulations).
  2. Rules are related with everything: visibility, confort, access, evacuation in an emergency, facilities, track/seat topology … blah blah. Of them visibility and seat sectors/segmentation (access/evacuation) are the paramount ones.
  3. Rather do modules (solids) and then trim them than trim rail curves.If the seats LBS is concrete then the whole assembly is simpler (but a bit archaic).
  4. Repeated modules (and any repeated item in fact ) must be instance definitions (you can’t do that propely without code … so forget it for the moment).