News:

Please note new Forum URL: forum.designcad.com

Main Menu

Surface Connect tricks

Started by Dr PR, March 12, 2014, 10:15:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

I have been using "Surface Connect" and "Surface Patch" for years, and I have learned a few tricks along the way. It took a long time to learn, though, and I still don't understand some things. For example, what do "Planes Across" and "Planes Down" mean in "Surface Patch?" Up/down and across are meaningless to me for tilted surfaces in 3D space.

The keys to solving the problems with "Surface Connect" are:

1. Use enough "planes per line" to allow smooth contouring around curved sides.
2. Use the original points. For this you MUST position the points carefully (trial and error) and have enough points to make smooth curves. When original points are used the "planes per line" value is ignored.
3. Control point order so that all lines are generated in the same general direction. You can use the InfoBox "Reverse order of the points" button (double arrow  blue over red) to change the point order.
4. If you use closed lines it is imperative that you start each line at the same relative position. If you don't the grid will twist or spiral around the surface, and this can create "wrinkles."

****

I have always been a bit paranoid about "Surface Connect" and how I position lines. Lately I have learned a bit more. In the attached "Surface connect.jpg" picture (the top of a cabin on a Navy 28' personnel boat) the lines I used for the "Surface Connect" function were transverse, left to right, or parallel to the back edge in the image. I used zero "intermediate breaks" so there was a line at every transverse edge of the planes, 18 lines in all.

I selected the "Use original points" option. When I created the lines I spaced the points close together at the most curved sections and farther apart where there was little curvature. This created the unequal facet sizes across the surface and reduced the grid size (file size, rendering time, etc.) considerably.

Another thing I did to get the compound curvature and rounded "corners" along the front edge was place the front seven lines so the endpoints are at the same positions. As you can see this worked very nicely to generate the compound curves.

This technique of controlling the points can be very useful where you want to join two surface grids without any gaps between them.

Also, grids are limited to about 5000 points I am told, and you can easily exceed this number of you use a lot of unnecessary planes per line and intermediate breaks. Controlling point position and using the original points allows you to make a larger or more complex grid surface without exceeding the maximum number of points.

****

Keeping these ideas in mind, with a bit of fiddling you can make complex grids work. For example, in the figure in the "Surface patch 2.jpg" picture:

1. Only two points are necessary on each line for the left and right hand sides - that will create only one trapezoidal facet on each side.
2. On the top and bottom sides you need the same number of points on the inside and outside lines (not necessarily the same for the top edge as the bottom edge).
3. You don't need any intermediate points on the straight edges, but you should have a lot of points on the curved parts.
4. The inside line along the top side should have the same number of points as the outside edge with the curve.
5. You should start drawing the inside and outside lines at the same corner (such as the top left) and draw the points in the same direction around the figure (clockwise).
6. Use the "Use Original Points" option and the grid will be created exactly as you have defined it with the points.

Of course this example isn't perfect, because inward curvatures can cause problems. The bottom right part of the curved edge has a facet that folds back upon itself. You can always make the curved "bump" a separate grid.

****

One thing that you can do to create kinks in curves (C) is to put two points at the same position. If you use curves with kinks in them you can create "knuckles" in the curved surface. For this to work correctly you nearly always have to use the "Use Original Points" options and make the point count and kink positions the same in every curve.

Phil

PS: Thanks to Allen Blincoe (Alblincoe) for stimulating thoughts on this subject, and for the example in "Surface connect 2.jpg."
DesignCAD user since 1987

prl

#1
Quote from: Dr PR on March 12, 2014, 10:15:22 PM
what do "Planes Across" and "Planes Down" mean in "Surface Patch?" Up/down and across are meaningless to me for tilted surfaces in 3D space.

Phil, I share your frustration at the terminology.  Above, below, in front of, behind, etc. all become meaningless in a tilted  3d world.

As you know and have discussed above, grid lines are the key to grids.  Many times I just want to verify the grid lines or understand where they are.  The quick program below does that.  Maybe you will find it useful.

Edit:  I added a couple of graphic examples.  I extracted the grid lines from a DesignCAD sphere.  Then I selected one of them so you can inspect the points.  Then a complex ground surface.

'Program egl.d3m  (extract grid lines)

'1/12/2009 'cycle selection set and draw the grid lines for grids, used for verfication or surface rebuilding.

dim ent(10000), glist(10000)

include "dcadalias.d3i"

if sys(80)=0 then
  Message "Nothing selected. . . routine will end, press any key"
  END
end if

Sys(1027) = 4 'Yes/No MessageBox style
Message "This routine extracts grid lines from grid. Do you wish to continue?"
if sys(1028) = 7 then 'No
    sys(80) = 0
    end
end if

layy$=sys$(0)
if layy$ = "" then input "Enter destination layer number for extracted grid lines: ", layy$
laynum=val(layy$)
layer(laynum) = 6

gosub GetSelected 'loads the ent() array and corrects the maxsel variable

sys(36)=2
precision 15
for i = 1 to maxsel
  entity ent(i)
  query Ent_Type, etype
 
  if etype = 33 then
     Query Ent_Npts, epoints
     >line
     {
     <Layer [laynum]
     for j = 1 to epoints
          Query Ent_Point, j, ptX, ptY, ptZ
          <pointxyz [ptX, ptY, ptZ]
     next j     
     }
  endif
next i

sys(36)=0
regen
sys(1)=0
sys(1027) = 0
precision 0
Message "Finished.  Extracted duplicate grid lines are on layer", laynum
END


'subroutines follow

getselected: 'correct deficiencies to DesignCAD getselect statement
    maxsel = sys(80)
    tglcount = 0 'total grid line counter
   
    for j = 1 to maxsel
      getselect j, ent(j)
      entity ent(j)
      change Ent_ColorByLayer, 0
      if sys(90) = 32 then 'grid header, check for number of grid lines
         glcount = sys(99) 'grid line count
         for jj = 1 to glcount
           tglcount = tglcount + 1
           glist(tglcount) = ent(j) +  jj
         next jj
      endif
    next j
    sys(1)=0
    sys(80)=0
 
    'add the missing grid lines to the stored selection set
    for j = 1 to tglcount
        maxsel = maxsel + 1
        ent(maxsel) = glist(j)
    next j
return

Lar

#2
To get the lines out of a grid surface you can also duplicate it off to the side somewhere and 'vector convert'.

I would then manipulate just some of the lines one at a time (eg, by using resizing handles or scaling, to keep the smoothness of the line) then surface connect them to get a surface back, with the new shape. I find this more reliable than the hammer command.

Lar

prl

#3
Quote from: Lar on March 13, 2014, 06:46:45 AM
To get the lines out of a grid surface you can also duplicate it off to the side somewhere and 'vector convert'.

This usually gives you the lines in both directions so I'm never sure which ones are the grid lines.  But yes this general approach will work, provided you delete the lines that aren't the true grid lines.


For added clarification:
To emphasize what Phil is describing,  DesignCAD uses the true grid lines as a form of armature and stretches a skin (surface) between them. That is why Phil is also highlighting the point order of the grid lines.

samdavo

#4
Speaking of surface connect I recently drew this shoe.  I used surface connect (done in a hurry, and nothing to write home about).

The heel is just a cylinder added later.  For the rest ... Firstly I had to come up with contours as seen from the side.   All had to have 17 points and these had to roughly radiate from the centre so that the grid was something like what a spider would spin.  (the original spin doctors).

Then I had to delete the radiating spokes of the web.
Then surface connect the contours, being careful to pick points that lay along one of the spokes just deleted.

(EDIT  - unless I'm very careful, I can get a different final result depending on which "deleted spoke" I use ??  - the differences include "vanes" down the sides of the shoe etc , which are even evident in the white shoe to some extent - although maybe that's just poor choice of contours?  But sometimes it goes haywire, like a punk-rapper's-bad-hair-day-on-steroids )

First time I did this was the red shoe, and I screwed up the little toe - but having said that, texture mapping came to the rescue :)

The white shoe is better, but still not perfect, and as I say, has vanes on sides for some reason;  and the little toe remains broken, or pretty sick in any event. (2 cents)

samdavo

In the highly unlikely event that anyone wants to play with this drawing...
(thinking more of the surface connect than the texture mapping).

As I say, I found it quite tricky - extreme care probably gets consistent results.

samdavo

#6
Still it was more accurate that the human head I tried to draw once lol -  well, I only got as far as the chin :)  Poor buga looks like he's got a severe case of mumps!  Perhaps exacerbated by a attack of vampire wasps.

prl

#7
Quote from: samdavo on March 13, 2014, 01:22:31 PM
Still it was more accurate that the human head I tried to draw once lol -  well, I only got as far as the chin :)  Poor buga looks like he's got a severe case of mumps!  Perhaps exacerbated by a attack of vampire wasps.

Maybe someday we talk about point cloud data.  Basiscally one gets a lot of (x,y,z) data points for a shape, whether earth terrain, a building, or a person's face, and then analyze the points and drape/drop a mesh onto it.   Pretty neat.  I've seem some SketchUP routines reading the point cloud data.  I could probably get DesignCAD to do it, but I lack the use and motivation for it. 

Dr PR

prl,

Thanks. That macro will come in handy. Like Lar, I often manipulate points on the "Surface Connect" template lines to modify the grid. But that requires the original template lines to be in the drawing. When they aren't I recreate them by drawing a curve with gravity snapping.

Note: I use the term "template lines" deliberately, because "lines," "curves," etc. can refer to any part of the grid or original lines. We do use the original lines/curves as templates to form the grid.

I often create a grid with intermediate breaks and then draw a new intermediate template curve between the original template lines. This is a fast way to get more template lines in areas of the grid that need extreme curvature. After drawing these new curves I edit them to control the grid curvature.

Phil

PS: To everyone who posts macros on the forum - please put your name or handle in the macro. If it is really useful I may want to refer it to others, and I would like to give credit where due. But often I don't remember the original author of the macro, especially if it has been years since it was posted.
DesignCAD user since 1987