Bad Surface-Bug Maybe?

I have been experimenting with different ways to create a ship hull. I ran into this during my experiments. In the attached file I have a hull that I created using OffsetSrf. OffsetSrf created a bad object. I removed the bad surface (which was contributing nothing) and extracted the bad area (BLUE).

If I try to join the blue to the red I get a bad object. Diagnostics gives:

Rhino polysurface object is not valid.

brep.m_E[19] edge is not valid.
edge.m_vi[0]=edge.m_vi[1]=15 but edge.IsClosed() is false.
ON_Brep.m_E[19] is invalid.

(note three of the edges do not match up).

Alternatively, I can do extractsrf on the next hull segment on after the one that is visible (the second long segment making up the hull). Then explode the remaining hull segments.

After that I can join the blue to the red without getting an error. I can joint the segment removed with extractsrf without getting an error. I can keep adding the segments back until the last, aftmost segment causes a bad object.

Diagnostics give the similar result:

Rhino polysurface object is not valid.

brep.m_E[33] edge is not valid.
edge.m_vi[0]=edge.m_vi[1]=18 but edge.IsClosed() is false.
ON_Brep.m_E[33] is invalid.

I share in case this reflects a bug.

Problem Bad Surface.3dm (11.7 MB)

Untrim everything to fix the micro loops. Then rematch and redo the problem surf. Then trim it back for sweep2 worked for me. It won’t be pretty but it will be water tight.

There are a lot of bad areas in your model but the worst one is down at the other end…
There is one surface that should be made as 2
surfaces.
This file has just those 2 surfaces with an arrow pointing to where the bad spot was. bad_spot.3dm (1.8 MB)

Fixing that should get rid of the “bad object” warnings but it will not fix the mis-matched edges that won’t join properly

Thanks,

That is the very area I was experimenting with. I have been trying all kinds of things to make it less chaotic.

One thing I should ask about, it is a bad idea to extend such a surface then trim it back?

The top half of that surface looks like it works fine as simple untrimmed rectangle. The bottom half looks like it would work better as a trimmed surface. It looks like it also could be rectangular and trimmed by whatever it intersects with.

The problem I have had with the lower part is that, as the back end, I am stuck with the same and any variation is visible. I have been doing a lot of experiments on this area. I have tried making a rectangle and trimming but I have not been able to match the back edge. The edge always turns out wavy, back and forth over the straight sections.

The best luck I have had so ware was what you suggested, divide into multiple sections at each sharp angle.

If I try to extend the surface to get a rectangle, it starts folding back on itself before it extends out of the curved section.

That would be expected. A gnarly crooked edge when extended will just get more gnarly and more crooked.

I would suggest to make the surface rectangular by making the construction curves so that they extend past the intersection point and are all the same length (or if not the same length the lengths are only gradually and smoothly changing).
You can make the surface with history on and then use Intersect command with history and then tweak the input curves if you need to modify the intersection.

Of course doing the above is a lot easier if you work with tolerances that are in proportion with the size of the model. When you work with very small tolerance on a very large model you end up with exceedingly dense geometry that is difficult to work with.

The intersection of 2 smooth surfaces will be a smooth curve. So if you need the intersection curve to have kinks at sharp angles then you should divide into multiple sections at each sharp angle

This is from my experiment with rectangular frames. Here I have horizontal frames that are splines going through the vertical frames and ending at the edge. Then I extended them to the same length.

14%20AM![14%20AM|525x309]
Then I trim to the edge:

28%20AM

But rather than a straight edge, I get this type of waviness at the curved edge:

As I add more frames the amplitude decreases and the frequency increases for the waves

You should get a straight edge (when viewed from the right) if the surface that you are trimming with is straight.

Here is an example: loft.3dm (1.1 MB)

The pink surface is made with loft (uniform) from the blue curves which are all copies of one curve. The points are where the curves intersect the black trimming surface and the red curve is the intersection of the pink loft and the trimming surface. With history on you can edit the blue curves and the red intersection curve will update.

Thanks, what appears to work for me at this point is to extend the offset further to the left (beyond the end of the surface above) so that the arc-like curve can serve as a NetworkSrf frame. Then trim back.