Author Topic: Triangulation (re-visited)  (Read 317278 times)

0 Members and 3 Guests are viewing this topic.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #420 on: May 10, 2015, 03:42:08 PM »
Marko,

The gif does not make sense to me, or maybe you attached the wrong one ?

Also looked into the attached lisp file, but could not see what the issue was about.
Anyway i
It's getting late here, so maybe my eyeballs are not in the proper position.

May take a little while before I reply properly, as I will be traveling for the next 10 days.

ymg

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: Triangulation (re-visited)
« Reply #421 on: May 10, 2015, 04:26:49 PM »
ymg, I couldn't make better gif as it's big for the site... I'll explain :
- you told us to delete tin.dcl from temp folder, but you could make it be deleted automatically after usage, so I removed "fn" variable from locals and used (vl-file-delete fn) after two places (unload_dialog ...)... Now you can make updates to dcl and every new one will be actual...
- subfunction (regular) which is used in XSHAPE command had some typos, so I've modified it, not so important thing as it works and without my mod, but I think this was to be written correctly...
- finally at the end when main program is working, I've found that sometime CAD can't find distatpoint as point isn't on selected line, pline and to me it returned for first point dist nil and it should return 0.0...
So this line :
Code: [Select]
   (if (= opt 1)
      (progn
   (setq disl (mapcar '(lambda (a) (vlax-curve-getDistAtPoint en a)) pol))
...
I've replaced with :
Code: [Select]
   (if (= opt 1)
      (progn
   (setq disl (mapcar '(lambda (a) (vlax-curve-getDistAtPoint en (vlax-curve-getClosestPointTo en a))) pol))
...
and it worked - command PROFILE didn't fail...

Also I've noticed that you must start PROFILE command and cancel dialog to get displayed min and max Z values of section TIN, but I think that's not so important... DATUM values are recognized correctly in dialog, only this is little unexpected procedure for someone that wants to modify DATUM values...

So that's all that I've found till now... It works fine, congrats ymg...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #422 on: May 10, 2015, 05:36:29 PM »
Marko,

Yes I realize we could automate the cleaning of tin.dcl from the temp
directory.

However by doing so, we need to re-create every time we run the program.
But this is not a big issue, just a matter of preference.  However with the number
of revisions I am cranking out, your suggestion make sense.

Although, I never experienced any issues the suggestion of adding (vlax-curve-getClosestPointTo en a) is a safer way to go about it.  So It will be added.

The last comment about canceling the dialog, I do not understand.  The minZ and maxZ are written
to the command line area, before starting the dialog.  So I do not cancel and restart it.
This is there, only as a matter of preferences as I like to see the range of the data, although
function nicetick should give us reasonable values.

I appreciate your comments as they are always well researched.

Thanks!!,

ymg


ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: Triangulation (re-visited)
« Reply #423 on: May 11, 2015, 12:02:53 PM »
Hi ymg, I had free time, so I've updated your code on V0.6.4.1 ... I've added an option to erase inside polyline points along with 3DFACEs and I've formatted code so that it looks from notepad ++ like in VLIDE (replaced tab char with 8 spaces chars)... So from now I suggest you that you use space while writing... I'll attach LISP along with DWG where you can test it's functionality... Something more is different - I've noticed that when using (ssget "_WP") or (ssget "_CP") if PDMODE is different than 0 (point is larger shown with style) - (ssget) may cross with selection and undesired points - point cross presentation and not exactly point, so I've added changing to sysvar PDMODE 0 value when c:TIN - this way it's ensured correct selection is made... Also added few cosmetic changes at the end (UCS - World and PLAN) so when you load TriangV0.6.4.1.lsp correct setting of those preferences are done... Also if I may conclude, new version operates with POLYLINE entities as Constraints that may or may not pass through POINTs... In my DWG there are 2 3dpolys that are independent of POINTs and TIN is made correctly with erasing inside points...

So you can experiment now with your versions, but I suggest that you check this one as I think you may continue to work and with it on future projects...

M.R.

[EDIT : Reattached TriangV0.6.4.1.lsp with my latest posted fix... Little more spaces reducing after lines of code... There were 8 downloads till reattaching...]
« Last Edit: May 13, 2015, 09:45:29 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #424 on: May 11, 2015, 04:06:18 PM »
Marko,

Thanks for your effort, but I am already at version 0.6.4.4 at home.

Although, I value your input very much, I would appreciate if you would
refrain from posting revision to the program.  On your copy you may
of course do whatever suits you.

Although the 3d polyline not touching a point may be a need for you
I don't want the program to operate this way.

For my part constraint should go through points.

I will look at it, and see what gets implemented in the next version.

ymg

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: Triangulation (re-visited)
« Reply #425 on: May 12, 2015, 03:44:07 AM »
ymg, I've noticed also that sometime eroding with [ + ] while XSHAPE bugs with nil...

I've changed this :
Code: [Select]
   (defun xshape (ratio / a b bl ch e kl lg ne ps tn tr v)           
      (setq kl nil)
               
      (setq ch (get_extcont) ;el (get_edges tl)
            bl (mapcar '(lambda (a b) (list a b)) ch (cdr ch))
                           
            lg (* (apply 'max (mapcar '(lambda (a) (distance (nth (car a) pl) (nth (cadr a) pl))) bl)) ratio)
      )
     
      (while bl
         (setq  e (car bl)
               bl (cdr bl)
               tn (/ (vl-position e el) 3)
               tr (nth tn tl)
         )
...

To this :
Code: [Select]
   (defun xshape (ratio / a b bl ch e kl lg ne ps tn tr v)           
      (setq kl nil)
               
      (setq ch (get_extcont) ;el (get_edges tl)
            bl (mapcar '(lambda (a b) (list a b)) ch (cdr ch))
                           
            lg (* (apply 'max (mapcar '(lambda (a) (distance (nth (car a) pl) (nth (cadr a) pl))) bl)) ratio)
      )
     
      (while bl
         (setq  e (car bl)
               bl (cdr bl)
               tn (if (vl-position e el) (/ (vl-position e el) 3) nil)
               tr (if tn (nth tn tl) nil)
         )
...

Note (if) statement in (while bl (setq ... )...) ... It seems that with this mod it won't exit with nil...
So implement this fix, if it's correct inside posted Triang.lsp ...

[EDIT : I've reattached TriangV0.6.4.1.lsp with this fix and setq-ed nl (neighbor list) after rebuilding triangle list if there were deletion of inside points of Constraints just in case other subfunctions need this variable and I see that some of them need it...]

M.R.
« Last Edit: May 13, 2015, 11:45:00 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

BlackCADDER

  • Mosquito
  • Posts: 17
Re: Triangulation (re-visited)
« Reply #426 on: May 14, 2015, 07:26:44 PM »
'ymg' you are a genius.
I am using your program right now to generate pipeline profiles on the 'wheatsone lng plant' project in West Australia.
In the past I would be using 12D. This program does the job. The client supplied a triangulation of the site, your program does the rest.
Again, great work.
"Permission to ask a question, sir... "
"Permission granted, Baldrick, as long as isn't the one about where babies come from."

chlh_jd

  • Guest
Re: Triangulation (re-visited)
« Reply #427 on: May 17, 2015, 06:05:32 AM »
'ymg' you are a genius.
I am using your program right now to generate pipeline profiles on the 'wheatsone lng plant' project in West Australia.
In the past I would be using 12D. This program does the job. The client supplied a triangulation of the site, your program does the rest.
Again, great work.



1+

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #428 on: May 18, 2015, 08:46:08 AM »
Thanks !! for all the praises.

But the "Genius" should go to the guys who invented those things.

ymg

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #429 on: June 06, 2015, 03:10:16 AM »
Hi ymg. Any news about TriangV0.6.4.0 .lsp .Any updated version ?

Thanks

mac0312

  • Mosquito
  • Posts: 13
Re: Triangulation (re-visited)
« Reply #430 on: July 13, 2015, 04:27:15 AM »
ymg,
I use TriangV0.6.4.0 .lsp to generate a triangulation, but the program is running very slowly, and the ADS request error occurs. Please see the attachment!


ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #431 on: July 13, 2015, 03:29:01 PM »
mac0312,

The program will error with more than 32767 points due to
limitation on the acet progress bar.

You can either remove every call to acet-ui-progress or modify
to call every 10 or 100 points.

Removing will give you a bit of speed at the cost of not having
any feedback while the program is running.

The other item that slows thing down every point is being checked for duplicates
and whether they are part of breaklines.  It does take time.

If you are sure that you do not have duplicates, you could bypass that.

ymg



mac0312

  • Mosquito
  • Posts: 13
Re: Triangulation (re-visited)
« Reply #432 on: July 14, 2015, 12:05:33 AM »
ymg,thank you very much for your detailed explanation.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #433 on: July 26, 2015, 11:15:45 AM »
Here I've added Depression Contour Handling in this version.

(Corrected a bug in version 6.5.0, rplaced by version 6.5.1)

ymg
« Last Edit: August 05, 2015, 02:02:14 PM by ymg »

vpatilhas

  • Guest
Re: Triangulation (re-visited)
« Reply #434 on: July 31, 2015, 06:52:45 AM »
Hy

Ymg

I can use the lisp with triangulation already made or how we correct the errors of triangulation in order to make a correct contour?

Thanks