Author Topic: - = { Challenge } = - Best Way to Represent an Alignment in Vanilla Cad  (Read 4662 times)

0 Members and 1 Guest are viewing this topic.

ymg

  • Guest
How would you guys attach to a 3d polyline the data representing
a complete Road Center Line, all this in Vanilla Cad.

We need to be able to attach the horizontal and vertical curves.
The horizontals curves also might have spirals or easement curves.

All this to be able to select the 3dpoly and be linked with all that data.

ymg
« Last Edit: April 30, 2015, 06:26:14 AM by ymg »

Swift

  • Swamp Rat
  • Posts: 596
you have a design alignment now?

I'm not sure you can get an exact representation but a good representation is certainly possible, with a suitable Delta spacing of points.

Swift

  • Swamp Rat
  • Posts: 596
Is this a one time thing or will it be reoccurring and you need a process for it?

ymg

  • Guest
Swift,

As you probably know there is  this triangulation program
that I've been working on for a while. (See attachment)

In it there is a function to extract a profile from the tin.
However right now the center line is represented by
an LWpolyline with bulges for horizontal curves.

To be truly useful what we need is an alignment
and extract the profile from this.

ymg

« Last Edit: April 30, 2015, 05:00:39 AM by ymg »

Swift

  • Swamp Rat
  • Posts: 596

I'm sorry but I do not know enough Lisp to even follow your code


Conceptually, I have some thoughts but I do not understand your process enough to be able to offer any meaningful guidance or a solution.


If I understand you correctly now you are seeking to take a designed centerline and by "designed centerline" I mean one generated with tangent segments and tangent curves which may or may not have polynomial spiral transitions.


And you wish to obtain a profile along this alignment from a tin.


The problem that I see is that you cannot maintain a true 3-D polyline with segments and still represent the elevation of every intersecting tin triangle edge. You could however intropolate every point of interest to an elevation on the tin but I doubt this is the solution you are after.


To the best of my understanding the only way to truly represent this is to decompose your horizontal alignments down to segments defined by the location of intersecting tin edges which then presents a few problems in that horizontal points of interest, i.e. what I would refer to as PC,PT, TS,SC,CS,ST will most likely not fall on a triangle edge and these points will have to be intropolated between the previous and next vertex or you will have to solve elevation of the point within the triangle that it resides


It is an interesting challenge


ymg

  • Guest
Swift,

The extraction from the tin is not really a problem.
Lots of details but can be managed.

What I am after is how to attach the pertinent details
to the 3d polyline.  More like a parametric representation.

We can always re-calculate on the fly the spiral or the
vertical curve as we extract.

My thinking is may be extended data, where we have
vertices number of the curve, and radius etc.

Then we have to be able to modify this data as we revised
the alignment.

As you say, interesting challenge.

ymg

HasanCAD

  • Swamp Rat
  • Posts: 1422
error when run
Quote
Error: no function definition: MASSOC-FUZZ

ymg

  • Guest
HasanCad,

Sorry about that,looks like I did too much
cleanup.

I corrected the above.

here are the functions.

Code - Auto/Visual Lisp: [Select]
  1. ;; assoc-fuzz   by Irneb                                                      ;
  2.  
  3. (defun assoc-fuzz (k l fuzz / found)
  4.   (while (and (setq found (car l)) (not (equal k (car found) fuzz)))
  5.     (setq l (cdr l))
  6.   )
  7.   found
  8. )
  9.  
  10. ;; massoc-fuzz    by Gile Chanteau (Modified to use Irneb's assoc-fuzz)       ;
  11. ;; Retourne la liste de toutes les valeurs pour le code spécifié              ;
  12. ;; dans une liste d'association                                               ;
  13. ;;                                                                            ;
  14. ;; Arguments                                                                  ;
  15. ;; key : la clé à rechercher dans la liste                                    ;
  16. ;; alst : une liste d'association                                             ;
  17. ;;                                                                            ;
  18.  
  19. (defun massoc-fuzz (k l fuzz)
  20.   (if (setq l (member (assoc-fuzz k l fuzz) l))
  21.      (cons (car l) (massoc-fuzz k (cdr l) fuzz))
  22.   )
  23. )
  24.  

ymg

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
massoc-fuzz could be simply:
Code - Auto/Visual Lisp: [Select]
  1. (defun massoc-fuzz ( key lst fuz )
  2.     (vl-remove-if-not '(lambda ( itm ) (equal key itm fuz)) lst)
  3. )

Or:
Code - Auto/Visual Lisp: [Select]
  1. (defun massoc-fuzz ( key lst fuz )
  2.     (apply 'append (mapcar '(lambda ( itm ) (if (equal key itm fuz) (list itm))) lst))
  3. )

Or:
Code - Auto/Visual Lisp: [Select]
  1. (defun massoc-fuzz ( key lst fuz / rtn )
  2.     (while lst
  3.         (if (equal key (car lst) fuz) (setq rtn (cons (car lst) rtn)))
  4.         (setq lst (cdr lst))
  5.     )
  6.     (reverse rtn)
  7. )

Or, if you really wanted to use recursion:
Code - Auto/Visual Lisp: [Select]
  1. (defun massoc-fuzz ( key lst fuz )
  2.     (cond
  3.         (   (null lst) nil)
  4.         (   (equal (car lst) key fuz) (cons (car lst) (massoc-fuzz key (cdr lst) fuz)))
  5.         (   (massoc-fuzz key (cdr lst) fuz))
  6.     )
  7. )
« Last Edit: April 30, 2015, 06:11:33 AM by Lee Mac »

ymg

  • Guest
Thanks!  Lee

In my case need to modify your proposal to:

Code - Auto/Visual Lisp: [Select]
  1. (defun massoc-fuzz (k l fuzz)
  2.     (vl-remove-if-not '(lambda (a) (equal k (car a) fuzz)) l)
  3. )



ymg
« Last Edit: April 30, 2015, 07:55:46 AM by ymg »

ymg

  • Guest


Found some interesting stuff on the subject of Alignment:

   http://www.buildingsmart-tech.org/infrastructure/projects/alignment

ymg

lamarn

  • Swamp Rat
  • Posts: 636
 civil3d 2016 supports ifc2x3. Surely intresting to make a 'bridge' between bsa and autocad verticals.
Design is something you should do with both hands. My 2d hand , my 3d hand ..

ymg

  • Guest
lamarn,

Yes, I could see that Autodesk had many of its vertical product certified.

Not sure I am up to it, but I'll study some.

ymg

ymg

  • Guest
Thinking aloud! here.

How about attaching XML in extended data ?

However they are very verbose.

ymg
« Last Edit: May 07, 2015, 08:10:53 AM by ymg »

dgorsman

  • Water Moccasin
  • Posts: 2437
Why bother with XML?  Extended data will handle anything XML can handle, and almost as gracefully.  The only thing it won't do is provide the advanced XPath syntax searching, but then again it can be built into the interface.  And it will do things that XML cannot do, like store persistent hard and soft pointers.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}