Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ko:rhino:badobjects [2020/08/14]
127.0.0.1 external edit
ko:rhino:badobjects [2024/08/14] (current)
heeyoung
Line 1: Line 1:
-====== How to find and (hopefully) fix bad objects created by Rhino, or by importing from other programs ====== +======Fixing Bad Objects======
-======I’ve got a bad object, why did that happen and how do I fix it?======+
  
-=====What is a bad (invalidobject?=====+>How to find and (hopefullyfix bad objects created by Rhino, or by importing from other programs
  
-“Bad” objects in Rhino are ones that either violate certain [[rhino:nurbs|NURBs]] rules, or have structural problem In theory, Rhino is not supposed to produce bad objects, but in practice, it is possible and does happen periodically.  Once you know how to deal with them, they don’t usually take too much to fix.  Most often, the bad objects are surfaces, but bad curves also happen occasionally as well.+=====I’ve got bad objectWhy did that happen and how do I fix it?=====
  
-=====How do I know if I've got one?=====+====What is a bad (invalid) object?====
  
-The simplest way to find bad objects is to use the command **SelBadObjects** (Analyze > [[rhino:diagnostics|Diagnostics]] > Select Bad Objects).  All objects considered as invalid will be selected.  However, a polysurface may be "bad" because it contains only one bad surface.  You can figure out which one by using the command **ExtractBadSrf** (not in the menus)which will extract the bad surfaces and select them.  There is a very useful command in Rhino called **CheckNewObjects**which turns on checking in the background and checks all objects as they are created or imported.  This way you know immediately when there’s a problem.+“Bad” objects in Rhino are ones that either violate certain [[rhino:nurbs|NURBS]] rulesor have structural problem.  In theory, Rhino does not produce bad objects, but in practiceit is possible and does happen periodically.  Once you know how to deal with them, they don’t usually take too much to fix.  Most often, the bad objects are surfaces, but bad curves also happen occasionally as well.
  
-=====Why are these objects considered bad and how were they created?=====+====How do I know if I've got one?====
  
-Well, there are many technical explanations.  With surface objects, often it is the structure of the trim curve that is bad – it can have one or more segments that are microscopic and this causes problems.  Other times surface can be bad because it has either two or more rows of control points on top of each other, or has a zero length in one direction (a “collapsed edge”).  This situation is easy to produce in Rhino V3 – make a vertical plane or line and then project it to the Cplane from the Top View.  The object now has zero length in one direction and will be considered bad.  In Rhino V4this type of operation has been "disallowed" in certain cases, so that you will not get a bad object, the command will simply fail and you will get an error message.  However, it is still possible to produce bad objects in V4.+The simplest way to find bad objects is to use the command **SelBadObjects** (//Analyze>Diagnostics>Select Bad Objects//).  All invalid objects will be selected.  But polysurface may be bad if it contains only one bad surface.  You can figure out which one by using the command **ExtractBadSrf** (not in the menus), which will extract the bad surfaces and select them.  There is a useful command in Rhino called **CheckNewObjects**which turns on checking in the background and checks all objects as they are created or imported.  This way you know immediately when there’s a problem.
  
-Why might a surface trim curve be bad?  You probably didn’t intentionally make it so.  Bad objects often show up after using Join (or some other command that also joins objects, like Booleans). In the process of joining objects, Rhino often needs to split edges and adjust trim curves.  In certain situations parts of these split edges can end up being microscopic or the adjustment of the trim curve goes wrong and all of a sudden //<color magenta>Bing!!</color>// you will have a bad object.  //(By the way, when I say “microscopic” I mean smaller than your absolute tolerance – objects that are smaller than that generally have no business in your file and will cause problems.)//+====Why are these objects considered bad and how were they created?====
  
-=====Bad objects on Import/Export=====+Well, there are many technical explanations.  With surface objects, often it is the structure of the trim curve that is bad. It can have one or more segments that are microscopic and this causes problems.  Other times a surface can be bad because it has either two or more rows of control points on top of each other, or has a zero length in one direction (a collapsed edge).  This situation is easy to produce in Rhino V3: make a vertical plane or line and then project it to the Cplane from the Top View.  The object now has zero length in one direction and will be considered bad.  In Rhino V4, this type of operation has been disallowed in certain cases, so that you will not get a bad object. The command will simply fail and you will get an error message.  Yet, it is still possible to produce bad objects in V4.
  
-Importing geometry from other programs can also produce bad objects.  If you are running **CheckNewObjects**, while file is importing you will get message if and when an invalid object has been created.  You need to click OK to acknowledge each one If there are many, this can be annoying, you can turn the command off and restart it after the import is done.+Why might a surface trim curve be bad?  You probably didn’t intentionally make it so.  Bad objects often show up after using **Join** (or some other command that also joins objectslike Booleans). When joining objects, Rhino often needs to split edges and adjust trim curves.  In certain situations parts of these split edges can end up being microscopic. Or the adjustment of the trim curve goes wrong and all of sudden //<color magenta>Bing!!</color>// you have bad object.  //(By the way, when I say “microscopic” I mean smaller than your absolute toleranceObjects that are smaller than that generally have no business in your file and will cause problems.)//
  
-It is important to understand that the imported objects were likely not considered "bad" in  the originating program.  Every program has its own way of creating and checking geometry, and those may not be the same as how Rhino goes about it.  On top of that, exchanging data between programs that have different formats requires at least one translation and sometimes two (via a "neutral" format such as IGES), there can translation problems that will cause bad objects, depending on the quality of the import/export functions.  Rhino will also produce objects that it does not consider as "bad", but are flagged as "bad" by other programs.+====Bad objects on import/export====
  
-=====Phantom surfaces=====+Importing geometry from other programs can also produce bad objects.  If you are running **CheckNewObjects**, while a file is importing you will get a message if and when an invalid object has been created.  You need to click **OK** to acknowledge each one.  If there are many, this can be annoying. You can turn the command off and restart it after the import is done. 
 + 
 +It is important to understand that the imported objects were likely not considered bad in  the originating program.  Every program has its own way of creating and checking geometry, and those may not be the same as how Rhino goes about it.  On top of that, exchanging data between programs that have different formats requires at least one translation and sometimes two (via a neutral format such as IGES). Translation problems can cause bad objects, depending on the quality of the import/export functions.  Rhino will also produce objects that it does not consider bad, but are flagged as bad by other programs. 
 + 
 +====Phantom surfaces====
 //Why can't I see my bad object?// //Why can't I see my bad object?//
  
-Occasionally, Rhino produces surfaces that are bad, but you can't see them.  Literally, they are invisible!  (they are invisible because no render mesh was able to be produced to display them) They are sometimes referred to as "phantomsurfaces.  Phantom surfaces can cause files to act oddly, for example a **ZoomExtents** that doesn't work correctly because the invisible surface is out in space and the **Zoom** command is taking it into account.+Occasionally, Rhino produces surfaces that are bad, but you can't see them.  Literally, they are invisible!  (They are invisible because no render mesh was able to be produced to display them.) They are sometimes referred to as phantom surfaces.  Phantom surfaces can cause files to act oddly, for example a **ZoomExtents** that doesn't work correctly because the invisible surface is out in space and the **Zoom** command is taking it into account.
  
-These can usually be selected with **SelBadObjects**, and the best thing is to simply use Delete to get rid of them - often they can't be fixed.  Sometimes, Delete won't work, if that happens, try **Ctrl+X** to cut them from the file.  If you  cannot select them in any other way, you can also try this:  Zoom extents, window select everything and use Hide.  Then try a Ctrl+A.  Usually this selects everything in the file, even objects that are unselectable any other way.  If you see on the command line that an object is selected, use What to verify that it is indeed your bad object (it will say "invalid"), then just delete it and show all again.+These can usually be selected with **SelBadObjects**, and the best thing is to simply use **Delete** to get rid of them. Often they can't be fixed.  Sometimes, **Delete** won't work. If that happens, try **Ctrl+X** to cut them from the file.  If you  cannot select them in any other way, you can also try this:  Zoom extents, window select everything and use Hide.  Then try a Ctrl+A.  Usually this selects everything in the file, even objects that are unselectable any other way.  If you see on the command line that an object is selected, use **What** to verify that it is indeed your bad object (it will say "invalid"), then just delete it and show all again.
  
  
-===== Bad Meshes===== +==== Bad meshes==== 
-If a polygon mesh object rings up as bad, use **CheckMesh** to see a more detailed report of what is  wrong with it- this command will tell you a good deal about what can be fixed, and you my well find the commands you need among the offerings in the Mesh menu, under mesh Edit tools and mesh repair tools. Some useful commands are:+If a polygon mesh object rings up as bad, use **CheckMesh** to see a more detailed report of what is  wrong with it. This command tells you a good deal about what can be fixed, and you may find the commands you need among the offerings in the Mesh menu, under mesh Edit tools and mesh repair tools. Some useful commands are:
  
 **ExtractDuplicateMeshFaces** **ExtractDuplicateMeshFaces**
Line 43: Line 46:
 =====OK, How do I fix bad curves and surfaces?===== =====OK, How do I fix bad curves and surfaces?=====
  
-Bad polycurves are most often fixed by just exploding and re-joining.  Otherwise, look for microscopic segments included in the curve and eliminate those.  If that still doesn't fix things, it may be that something may really be wrong with the [[rhino:nurbs|NURBs]] knot structure of the curve, and will require more advanced investigation and/or reconstruction.+Bad polycurves are most often fixed by just exploding and rejoining.  Otherwise, look for microscopic segments included in the curve and eliminate those.  If that still doesn't fix things, it may be that something is really wrong with the [[rhino:nurbs|NURBS]] knot structure of the curve, and it requires more advanced investigation and reconstruction.
  
-My strategy for dealing with bad surfaces due to trim curves is as follows - before starting, determine which are the bad surfaces and hide everything else temporarily (you may need to run **ExtractBadSrf** as above).+My strategy for dealing with bad surfaces due to trim curves follows. Before starting, determine which are the bad surfaces and hide everything else temporarily (you may need to run **ExtractBadSrf** as above).
  
-**1.** First I usually run the command **RebuildEdges** on all bad objects. This may fix some. It more or less restores the edges of a surface to the state they were before joining.  However it also means that the surface might no longer join up to its neighbors, or that joining might make it go bad again. But it does work OK in some cases.  If some surfaces are fixed (use **SelBadObjects/Invert**), hide those.   Sometimes running **ShrinkSrf** on bad surfaces also helps.+**1.** FirstI usually run the command **RebuildEdges** on all bad objects. This may fix some. It more or less restores the edges of a surface to the state they were before joining.  But it also means that the surface might no longer join up to its neighbors, or that joining might make it go bad again. But it does work OK in some cases.  If some surfaces are fixed (use **SelBadObjects/Invert**), hide those.   Sometimes running **ShrinkSrf** on bad surfaces also helps.
  
-**2.** Use the Untrim command with the "keep trim objectsoption selected (otherwise known as **DetachTrim**) on the first bad surface, then, while the trim curve is still selected, use Trim to re-trim the surface.  Check to see if this has fixed the surface If so, good, hide it, if not, leave it and run the same procedure on all other bad surfaces one at a time.  Hide all that go good.+**2.** Use the **Untrim** command with the **keep trim objects** option selected (otherwise known as **DetachTrim**) on the first bad surface, then, while the trim curve is still selected, use Trim to retrim the surface.  Has this fixed the surface If so, good, hide it. If not, leave it and run the same procedure on all other bad surfaces one at a time.  Hide all that go good.
  
-**3.** If any bad objects are left, run **DetachTrim** on them again. **Explode** the resulting trim curve and look for micro segments in the curve somewhere. This is the most common case of bad trims. Look at how many component curves the trim curve has. Often there will be a suspicious number, i.e. what looks like it should be a rectangle says 5 curves not 4. Somewhere in there is a micro curve that is messing things up. Often it's near a corner, try window selecting near the ends of your trim curve segments. Or, use the command **SelShortCrv** and set a small value.  If you find some microsegments, delete them and rejoin the trim curves into a closed loop. Re-trim the surface with it. This usually fixes pretty much everything that isn’t fixed by other methods.+**3.** If any bad objects are left, run **DetachTrim** on them again. **Explode** the resulting trim curve and look for micro segments in the curve somewhere. This is the most common case of bad trims. Look at how many component curves the trim curve has. Often there will be a suspicious number, i.e. what looks like it should be a rectangle says 5 curves not 4. Somewhere in there is a micro curve that is messing things up. Often it's near a corner. Try window selecting near the ends of your trim curve segments. Or, use the command **SelShortCrv** and set a small value.  If you find some microsegments, delete them and rejoin the trim curves into a closed loop. Retrim the surface with it. This usually fixes pretty much everything that isn’t fixed by other methods.
  
-**4.** Last, try unhiding everything (**Show**), and see if you can join all up without having objects go bad again.  If all joins up well and no bad objects, great!  If not, then it’s generally because Join is trying to force things together that don’t fit correctly.  In that case you’re going to have to analyze the surfaces that are going bad and the relation with their neighbors to try and find out what doesn’t fit and why.  This can sometimes take some pretty close looking and head scratching…+**4.** Last, try unhiding everything (**Show**), and see if you can join all up without having objects go bad again.  If all joins up well and no bad objects, great!  If not, then it’s generally because **Join** is trying to force things together that don’t fit correctly.  In that case you have to analyze the surfaces that are going bad and the relation with their neighbors to try and find out what doesn’t fit and why.  This can sometimes take some pretty close looking and head scratching…
  
 > **Note:** //The above methodology is for dealing with surfaces with bad trim curves.  It won’t help surfaces with collapsed edges or stacked rows of control points.  Those need to be dealt with by other methods such as knot removal or just plain reconstruction.  Surfaces with collapsed edges are easy to spot – the display looks like a curve, but in **Properties** it says it’s a surface.  In general just delete these.// > **Note:** //The above methodology is for dealing with surfaces with bad trim curves.  It won’t help surfaces with collapsed edges or stacked rows of control points.  Those need to be dealt with by other methods such as knot removal or just plain reconstruction.  Surfaces with collapsed edges are easy to spot – the display looks like a curve, but in **Properties** it says it’s a surface.  In general just delete these.//
 +
  
  
ko/rhino/badobjects.1597445311.txt.gz · Last modified: 2020/08/14 by 127.0.0.1