cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Offset normal to Surface

Offset normal to Surface

This had been discussed so long that the original post aren't even archived.

 

We need the ability to offset a surface. Landfill caps and certain types of excavation or fill need to be calculated this way. I WAS doing this in AutoCAD back in the 90's using a program called QuickSurf. Fifteen years ago I tried to write a lisp to do this using the NOR function in the Geometry Calculator. But, not being a programmer, I never finished it. So I believe this it doable but I don't know how much work it would take.

 

Allen

67 Comments
nbawden
Advocate

It is pathetic that expensive software like this can't do something this simple yet crticially needed in many common types of bulk earthworks. Get at it Autodesk!

Anonymous
Not applicable

I have a workflow I use to accomplish this, but it requires 3DS Max and some training.  I wrote an abstract for AU this year so everyone could learn it, but it was rejected.  It is crazy that Civil 3D does not do this natively.  

Status changed to: Future Consideration

This is a great idea, but the timing isn’t quite right for development consideration in the near term. As such, it is being put on the back burner to be re-visited at a later date. Please continue to comment and add your support.

 

Regards,

 

Peter Funk

Sr. Product Manager

Autodesk, Inc.

pieter_haeck
Advocate

Lots of our clients involved in earthworks are asking this, because the actual method (Z-directioni) isn't accurate enough for their kind of calculations. They are asking this for quite a few years.

Anonymous
Not applicable

We NEED this option in C3D. We are waiting for this for years.

 

Why we need this:

Our projects are mainly in the Netherlands, where we build and maintain dikes. Clay layers must be applied in layer thicknesses of, for example, 0.30 meters. Unfortunately, the slope angle is almost never consistent.

You won't believe this, but we are doing this al by hand, making featureline offsets at approximately every 10 meters (project length 17km). This takes months. The solution will be a BIG time saver.

 

VERY important!

If the surface is build out of featurelines, there should be a checkmark to "offset" these featurelines! Offset exactly to the breakpoint of the surface triangles.

pcchenard
Advocate

Why is this functionality not available yet?  It has been requested for YEARS and this should be a major priority for Autodesk for Civil 3D development.  With the millions of dollars that you make off of software subscriptions one would think that you would actually add some requested functionality with each software release.  GET ON IT!

Anonymous
Not applicable

I have written a dll to be netloaded into Civil 3D (2016 only) that will offset the surface based on a offset point being set perpendicular (normal) to the center of each triangle face by the given offset distance. The code is not protected, so it my be viewed by any decompiler. I did include a text file for the instructions. I have briefly tested with small and large surfaces for runtime errors. The surface created is named "AutoSurface-" and appended with milliseconds. (Although it is not needed). 

 

It seems there were two different approaches, I attempted the Normal to the Triangle Face and not the ballooning (growing) of the surface. The smaller the triangles the more offset points are generated. 

 

I apologize for not signing the dll, I have a 3rd party math dll that did not work with the signing process.  

 

Also, a variant of this solution would be create a skeleton automatically of the current surface with FeatureLines and create another offset surface with the featureline offset routine. I may try that in the near future this does not give the desired result.

 

Here is the download link:

 

Link to Dll

 

https://drive.google.com/open?id=0B6BFlGfLeSw3ZFRuOGgwcko5bW8

 

Daryl

 

BernhardBicking
Participant

Hi daryl,

I am very surprised that you solved this problem. Unfortunately it does not work properly with the German version.

The (german) Error

Der Typeninitialisierer für "MathNet.Numerics.LinearAlgebra.Vector`1" hat eine Ausnahme verursacht.

will mean:

The type initializer for "MathNet.Numerics.LinearAlgebra.Vector`1" has caused an exception.

But I will continue to pursue your work with great interest

 

Bernhard

martin.folber
Advocate

Hi Daryl,

perfect 🙂 Just for kicking this function off. We will try that also...It is very necessary...

 

Thanks

Martin

martin.folber
Advocate

Hi Daryl,

so we tried that, but in fact we are not able just to load attached .dll? Isnt anything missing?

Also do you have any documentation to used MathNet Offset function?

 

Thanks

Martin

Anonymous
Not applicable

Thanks for trying! I am compressing the 3rd party library which is causing the issue. That's what I get trying not to creating an app. If it is the solution you need, then I will create an app for 2016 and upload.

 

I used a 3rd party math app,so I could perform long operations outside the single threaded Civil 3D. I did not need it, since it is actually not slow. I will change it over to the native managed Civil 3D library when I get a moment.

 

Here is the link to the Math dll. https://numerics.mathdotnet.com/ . I used Linqpad to put the tests together. There is a txt file with that code inside. Keep in mind this was a weekend project 🙂

 

I have zipped the VS 2015 Project Solution and uploaded.  Download Here VS-Project (Civil 2016)

I have zipped the dlls in a separate folder--that have not been post processed. You will need to netload three dlls, if the lightly obfuscated version is not working.

 

Netload these three files below found here Files

 

BBC.CivilSurf.001.dll

BBC.SurfOffet.001.dll

MathNet.Numerics.dll

 

or

 

The compressed dll is within the obfuscated folder

 

With in Civil 3D 2016

 

1.Netload the Dll by command "Netload"
2. Open a Civil 3D dwg with surface.
3. Run Command: BBC-CREATESURFACEOFFSETS
4. Select a TIN Surface:
5. Add an Offset Distance in Feet: 10
Done!

 

If it works, I will clean it up and put it in an app for you to download. It does not take long. I am curious if this approach is the solution.

 

Daryl

 

 

Anonymous
Not applicable

Here is the project and  source and in App folder format. Just drag it to your folder shown below:

 

C:\Documents and Settings\<your login>\Application Data\Autodesk\ApplicationPlugins

 

Here is a link to Download App.

 

The readme.txt has the information on the command. BBC-CREATESURFACEOFFSETS

 

Daryl

martin.folber
Advocate

Hi Daryl,

I have tested your app on Czech version of Civil 3D 2016 and the previous error appeared too...

 

The type initializer for "MathNet.Numerics.LinearAlgebra.Vector`1" has caused an exception.

 

Thanks for any suggestions

Martin

 

 

Anonymous
Not applicable

Thanks Martin,

 

Now, I am curious.

 

1. Remove the old App or Rename the folder as not to conflict with the new App. This will break the Civil Autoloader, which is fine. We will install another version with a different folder name.

2. Download and install the new App below. It has the 3 Dlls autoloaded for you that are not compressed.

3. If the error persists, let me know. I will port to the native Civil 3D libraries.

 

Here is a link to the App with 3 dlls

 

Thanks,

 

Daryl

martin.folber
Advocate

Hi Daryl.

thanks for the application. I am able to launch it and it somehow works, but I think the offset surface is not in correct elevation or to be more clear, the gap between surfaces is not 10 units perpendicular... and this should be main purpose of this function. Please see attached screenshots. Red surface is offset from green one...

offset1.pngoffset2.png

Thanks

Martin

Anonymous
Not applicable

Thanks Martin,

 

First, thanks for testing. My initial algorithm projected only the center point of a triangle in the normal direction. Therefore, there is a loss of 2/3 of the initial points in the newly created surface. This time I included 3 vertices along with the center point giving 4 points for every triangle. This solution with yield a better approximation.

 

One other consideration, is once I create the offsets, I send the new offset points to the Autodesk method to create the surface. For a 1 to 1 exact match, I can build the new surface with the original triangles with a offset, which will minimize the approximation of the new surface. 

 

This is version I am updating. It should have a folder name BBC-Surface-Offsets-1.bundle

 

Updated Download

 

My testing still shows 10 offsets. I am curious where the algorithm breaksdown.

 

Thanks,

 

Daryl

martin.folber
Advocate

Hi Daryl,

I have tested new version and new offset surface looks better than in previous version, but still offset 10units in on Z axis and not on normal direction from original surface...

 

Speed is OK, but If you ported to Civil 3D library, it would be even better...:)

 

Thanks

Martin

Anonymous
Not applicable

Hi Martin,

 

I have spent a few days figuring the best approach to handle this situation. In the near term, I have completed a solution that may work. However, there is a huge impact on performance. I would try it with a smaller surface or use the polyline boundary in the command to limit the area to offset. When I get a chance, I will look up the proper matrix transform to complete the solution. In the meantime, you will notice the UCS Icon quickly rotating as the program traverses the triangle faces to create the normal to each face. Below are the steps. I would suggest creating simple polyline in advance to add as outer boundary to the new surface.

 

One point to discuss that may help with the assessment is the test line created from the center of base triangle projected normal to the center of the offset triangle for a check. This may show where it fails.

 

Download Link

 

Command: BBC-CREATESURFACEOFFSETS
Select a TIN Surface:
Add an Offset Distance in Feet: 5
Create a Test Line from center of Base Triangle Normal to base of Offset Triangle? [Yes/No]: n
Select a polyline boundary:
Erase polyline boundary? [Yes/No]: n
Add the pline as the outer boundary? [Yes/No]: y
Starting the Program!
Number of Triangles to Process: !1209
Regenerating model.

 

If this works for you, I will submit it for App Submission after more cleanup.

 

Daryl

martin.folber
Advocate

Hi Daryl,

I have tested last version and results are unfortunatelly worse. Please see attached screenshots.

offset3.pngoffset4.png

Thanks

Martin

Anonymous
Not applicable

HI Martin,

 

I have reviewed the data, and as I was wondering through the forest blind, the smart people moved on with this problem. Here is the fundamental flaw.

 

Problem

 

If you draw two triangles connected a central point, which should create a shape of a bow tie. If the angles on the planes about the connecting point is greater than 180 degrees, the result of the angle convex--which does work when you offset perpendicular. However, if the angle is less than 180 degrees, the result of the shape is concave. Therefore, the consequences of the concave shape is space interference. In short, the triangle projected in a normal direction will at some point (offset distance) have crossing triangles from adjacent neighbors; thus, when I insert the points from the triangles into the new surface, the crossing points from the other triangles make a newly distorted triangle.

 

Illustration

 

From the information gathered, this type of offset is known as Vertical Translation. Attached is the example from the golf course bunker that I used as the test case, which has areas that are concave and flat. The white lines are the normals drawn as "lines". The red triangles are the original surface, and the grey triangles are the offset surface based on the normals that is failing in concave situations. Even at a Top View Perspective, you can see the crossing white lines into the red triangles causing the distortion. While you can minimize the offset distance to reduce the overlaps, it's far from a complete solution.

 

Triangle-Vertical-Translation.png

I will review documentation on 3DSMax for this type of situation. For now, I will need to determine the next approach with limited API access for developers. I will upload the latest version, so you can replicate my results if anyone is interested. 

 

As stated earlier, the outline of the surface with featurelines is a nice feature. I will move on to that next while keeping this problem on my mind. I have a few ideas.

 

Here is the link to the latest version. Download

 

Daryl 

 

 

 

   

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea