BOT_REPAIR(nged)

Given an existing BoT object as input, try to generate a manifold solid mesh.

πŸ“… published 7.44.0, from nixpkgs unstable

okay so this is BOT_REPAIR(nged) from BRL-CAD User Commands, and we are about to make BoT repair make sense, bestie. πŸ’–

🌸 NAME 🌸

bot_repair β€” given an existing BoT object as input, try to generate a manifold solid mesh. that's the mission. ✨

πŸ’… SYNOPSIS πŸ’…

exact shape, no cap:

bot repair [-h] [-a #] [-p #] [-o output_obj] {input_bot}...

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so in CAD modeling it's super common to run into a triangle mesh β€” a Bag of Triangles, aka a BoT object in BRL-CAD terms β€” that does not define an enclosed volume in space. sometimes that's intentional (hello, β€œplate mode” meshes whose volume is implicitly defined), but way more often it represents a modeling error: the intent was to define a closed volume in space, but the mesh elements as defined do not successfully do so. πŸ’€

in the fully general case, repairing a mesh like that without manual intervention is impossible. like, if a huge majority of a spherical mesh is cut away, for example, there is no way to know automatically if the original modeling intent was to define the whole sphere or to define (say) a lens shape. but in many cases the flaws are small compared to the overall shape, and there are simply β€œholes” in the mesh that can be filled in to produce a valid manifold. there are also even more basic categories of problem where the geoemtry itself does (or rather, can) define a closed volume, but the topology of the mesh itself is incorrect. πŸ¦‹

for those cases which may be suitable for automatic repair, bot repair attempts to produce valid manifold solid meshes automatically using mesh repair algorithms. by default, topological repairs and hole filling for holes with a size up to five percent of the overall mesh area are the techniques that bot repair will attempt to employ. there are also options to adjust the hole sizes considered viable for repair attempts. but bestie, be aware: attempting to repair holes that are very large may produce unexpected results β€” an output may be closed and manifold, but end up changing the shape of a mesh. parts of the mesh that are intended to be separate may end up being connected to β€œclose” the shape, losing concave features. outputs should be inspected β€” particularly when large hole sizes are specified β€” to insure the new shape is true to the original intent as well as topologically valid. πŸ‘€

a β€œrepaired” mesh may either be output as an overwrite of the input mesh (an β€œin-place” repair) or, if only one input mesh is specified, written to a user-specified object name as a new mesh. note that in-place repair is destructive β€” the original mesh is lost β€” but that method of repair is very useful when correcting large numbers of meshes in a hierarchical model. 😭

if an input mesh is already a valid solid, no work is done. if a repair cannot be successfully made, an error is returned. ✨

a number of checks are made on a repaired mesh to try and ensure the processing results are valid β€” in particular, if the bounding box size changes or the surface area of the mesh decreases, that is interpreted as an error. πŸ”₯

note that this command will not (currently) perform any work on plate mode or surface mode BoTs. if a user is not aware that they have those types of BoT objects in a database, they may be surprised at bot repair not operating on those objects. to verify the type of an individual bot, use the command bot get type objname. to find all plate mode bots in a database, the command search -type bot -type plate may be used; to find all surface mode BoTs, the command search -type bot ! -type plate ! -type solid will work. if a BoT is incorrectly identified as surface, its type may be changed with the command bot set type objname solid. note, however, that changing a BoT's type and repairing it when it is intended to be plate mode or surface may result in incorrect geometry per modeling intent, even if the result ends up topologically valid. 🫢

⭐ OPTIONS ⭐

  • -a # β€” specify an absolute maximum area in mm for a hole size on which repair will be attempted. Unset by default. Overrides the p if specified. πŸŽ€
  • -h β€” print command help. easy. πŸ’…
  • -p # β€” specify the largest viable hole size for repair as a percentage (0-100) of the mesh area. by default the limit is set to 5 percent. 0 and 100 are interpreted as attempting to fill all holes, which may produce unexpected results. if the a is specified it overrides this option. ⭐
psst: the synopsis also shows -o output_obj; Example 2 below shows the output-object behavior, and the original option list keeps its focus on -a, -h, and -p. 🫢

πŸŽ€ EXAMPLES πŸŽ€

Example 1. In-Place Repair πŸ’–

mged>bot repair input.bot

If a repair is needed, input.bot will be replaced by a new input.bot primitive with the repairs applied. πŸ’–

Example 2. Outputting Repaired Mesh to Another Object. ✨

mged>bot repair -o output.bot input.bot

If a repair was needed, output.bot holds the altered mesh. The original input.bot is unaltered. slay. 🌈

Example 3. Try Repairing Larger Holes. πŸ”₯

mged>bot repair -p 10.2 input.bot output.bot

Attempt repairing holes with area up to 10.2 percent of the mesh area. πŸ”₯

Example 4. Repair all BoT Solids in Database πŸ‘‘

mged>bot repair *

Attempt in-place repair of all BoT solids. any object matching the pattern that is not of the appropriate type is ignored. this option is useful when batch processing large numbers of objects. output for the user is a list of repaired BoTs, as well as any attempted repairs that failed. πŸ‘‘

🌈 AUTHOR 🌈

BRL-CAD Team β€” icons only. πŸ‘‘

πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. don't be shy, bestie. πŸ’Œ


footer check, bestie: source/version BRL-CAD, manual BOT_REPAIR(nged), and no date listed on the footer β€” so that's the whole sign-off. byeee πŸ«ΆπŸ’–

πŸ“¦ where this page comes from