Author Topic: ==={Challenge}===Find the ridge lines of sloped roof  (Read 106699 times)

0 Members and 1 Guest are viewing this topic.

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #120 on: June 20, 2014, 12:10:35 PM »
I've discovered that my 2droof3d.lsp had one lack - when start/end vertex of LWPL is the same than it failed... So I decided to post update and 2 lisps for converting arced LWPL to segmented one and lisp to execute before 2droof3d on segmented LWPL that is lisp that cleans double vertices that are the same... If everything is prepared (arced LWPL), and chlh_jd's 3D option failed, you should try with pline-arcs-seg.lsp, then clpls.lsp, then my posted 2droof.lsp (see previous post) and when solutions was find and correct, then apply here posted 2droof3d.lsp (this one is update - it operates and with LWPL with the same start/end vertex)...

Regards, M.R.

[EDIT : ] The topic that may also be of interest and that has some relation with posted routines - look into this link :
http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-convert-polyline-containing-tessellated-segments-to-true/m-p/5345845/highlight/true#M326908
[/EDIT]

[EDIT : ] "pline-arcs-seg.lsp" has small issue ab duplicate vertices at start/end of some segments... To fix this problem look here :
http://www.cadtutor.net/forum/showthread.php?89479-convert-arcs-in-polyline-to-small-lines&p=#7
[/EDIT]
« Last Edit: November 01, 2014, 03:45:21 PM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #121 on: June 24, 2014, 01:08:48 PM »
Ribar , thank you for your constant test  :-)
The bug in your post , has been fixed , see proof-10a.lsp and gif .
Though 3D to see 2D method , the program will  be more concise and efficient . Recently I have little time ,and I think it must add the exist island case , I'll try to do it later ... .
« Last Edit: June 24, 2014, 01:26:49 PM by chlh_jd »

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #122 on: June 24, 2014, 03:26:04 PM »
Thanks, chlh_jd... Now updated 2droof.lsp to reflect changes made in Proof_10a.lsp...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #123 on: June 25, 2014, 05:32:09 AM »
Again, new problem... chlh_jd, only if you wish and have time...

[EDIT] : I've modified 2droof.lsp to capture crash... You can download it also here - see attachment...

M.R.
« Last Edit: June 25, 2014, 05:54:46 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #124 on: June 26, 2014, 11:43:01 AM »
If it could help you, your previous version haven't failed on _ROOF-PROBLEM!!!.DWG and now it fails... Also, I've solved manually what should you get with my previous post...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #125 on: June 26, 2014, 12:05:39 PM »
Thanks Ribar .
The bug you post has been fixed . See proof-11.lsp and the gif .
In this version , I do some simplifying -- dump the last while loop and foo2 , greatly reduce codes of the main routine .

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #126 on: June 26, 2014, 01:35:01 PM »
Hi, Ribar
I think the '_ROOF - COMPLEX SOLUTION LOOPS - MANUAL SOLUTION' isn't correct , you can check them by offset method .

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #127 on: June 26, 2014, 02:18:35 PM »
Yes, you're right chlh_jd... But by offset tests, if you check it in 3D it will be correct... Never mind that, I think your last Proof_11.lsp is seriously the best... If I may conclude from my side, all my tests passed, so I'll leave to others if some revision is to be made... If I may say, I thank you very much for all your efforts to bring this topic to finish in appropriate way... This challenge inspired me to try to achieve and to improve my programming skills although I learned lisp by reading www on my own and I am not a programmer by a profession... I really want to thank to all the people I may disrespect in my past and from whom I've also learned lots of things... You are certainly one among them chlh_jd, and as I see now old topic have become actual and I also want to thank to Mr. Lee Mac for his unselfish will to help this community to be better... I already forgot ab topic where Lee asked why I removed his LM: prefix in his subfunctions and I explained what was true from one side of view - my subjective opinion... Objectively, he helped many people to understand better and improve programming skills and by that I am very thankful to him... I appointed that, but as I use lots of lisping, my library isn't the most appropriate for posting on the forums, many things have been modified over time and may not print contributions of all the people that deserve to be mentioned... But certainly code that was posted in the past has it's beneficial purpose and certainly wasn't posted to insult anyone... Lee felt that his contribution wasn't mentioned, but in fact this is the most apparent thing that is obviously present in almost every topic and code you can find on www... So I paid contribution to people that have no habit to leave any sign and are certainly good and skillful programmers like Lee is... Among them I see you chlh_jd, and many of them are still invisible to me... So in fact I want to thank to all of them and also Autodesk people that made their software so popular and practical...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #128 on: June 26, 2014, 08:42:12 PM »
Yes, you're right chlh_jd... But by offset tests, if you check it in 3D it will be correct...
One 2D closed curve reflect one best 3D roof , but it can be other 3D roofs which also can drainage .
Never mind that, I think your last Proof_11.lsp is seriously the best... If I may conclude from my side, all my tests passed, so I'll leave to others if some revision is to be made... If I may say, I thank you very much for all your efforts to bring this topic to finish in appropriate way...
...You are certainly one among them chlh_jd,
Thank you , Ribar  :-)
and as I see now old topic have become actual and I also want to thank to Mr. Lee Mac for his unselfish ...
I'v not seen dear and clever Lee Mac , a long time . I think he has a broad mind and forgive some one .
I do wish the disputes in Evgeniy's topic  is a start for some one , and also is a end for some one ---- Respect the labor of others is so important !

For me , If I made this mistake , I will send a Email to apologize .

In my mind , we shoud not only add the code's worker , but also shoud add the ideas / algorithms / mathematical principles, etc. References .
This is a better way to standing on the shoulders of Giants . It's only my personal views .

Thank you .


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #129 on: June 27, 2014, 07:42:00 AM »
I must say that when I first started Lisping back in 2003 I did not understand
the ownership of code. When collecting routines & subroutines I did not collect
the link to the source. This became a problem when I wanted to use the routine
in a posting of my own because often the author did not include a proper header
only a prefix on the defun name. The mistake I made was to include the
subroutine in my routine which I placed a header implying ownership. Fortunately
someone pointed out the error in my thinking (thank you MP) & I made an effort
to add headers to those sub-functions and links back to the source. This is like
foot notes in an article or book. So to omit these references is unthinking and
doing it regularly is rude behavior. I still have code floating around out in
cyberspace that I would like to correct but it is too late for most.
Once it leaves here you can not track it all down.

But now I make sure that any code I barrow has a reference to who or at least
where I obtained it so as not to IMPLY that I was the creator of the code. There
is a lot of effort and many late night study sessions that went into the ability
to create these routines that are so good that we want to reuse them rather than
create one of our own.

So honor that effort by including the proper header and or link back to the source.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #130 on: June 27, 2014, 04:33:09 PM »
Thanks Alan share your experiences and feelings  . I did this mistake too .

New version for reduce  codes ,  see proof-12.lsp

Due to personal time, this topic for me had to come to an end . It can be add the Island case .  I wish  someone can do it .

Code - Auto/Visual Lisp: [Select]
  1. ;;;-----------------------------------------------------------------------------;;;
  2. ;;;  
  3. ;;;  ---------------------------------------------------------------------------;;;
  4. ;;;  SlopedRoof                                                                 ;;;
  5. ;;;  ---------------------------------------------------------------------------;;;
  6. ;;;  function : Find the ridge lines of sloped roof                             ;;;
  7. ;;;  ---------------------------------------------------------------------------;;;
  8. ;;;  Return:                                                                    ;;;
  9. ;;;         2D -- SlopedRoof Lines / SlopedRoof Closed Polygons of  Each Side   ;;;
  10. ;;;                   / Frame lines, like get by voronoi method, more accurate  ;;;
  11. ;;;         3D -- SlopedRoof Closed Polygons of Each face                       ;;;
  12. ;;;                          / A Union Surface                                  ;;;
  13. ;;;                          / Solids of Each face                              ;;;
  14. ;;;  ---------------------------------------------------------------------------;;;
  15. ;;;  Writen By GSLS(SS) June 2014                                               ;;;
  16. ;;;        (C)  EasyCity OptDesign Studio of Building Structures                ;;;
  17. ;;;  Email: chlh_jd@126.com        Tel:86-592-5391029    Fax:86-592-5391020     ;;;
  18. ;;;  ---------------------------------------------------------------------------;;;
  19. ;;;  Main thread reference :                                                    ;;;
  20. ;;;      JianGuo Li, Algorithm about generate slopedroof line from 2D polygon.  ;;;
  21. ;;;      [BC Dissertation]Hubei University in China . 2009.                   ;;;
  22. ;;;      Many Thanks to JianGuo Li !                                            ;;;
  23. ;;;  -------------------------------------------                                ;;;
  24. ;;;  JianGuo Li's article main abort references :
  25. ;;;      [5] D.T.Lee. Medial axis transformation of a planar shape [J],IEEE Trans  
  26. ;;           PAM I , 1982, 4:363-369                                              
  27. ;;;      [6] Chin F, Snoeyink J., Wang C.A. Finding the medial axis of a simple    
  28. ;;;          polygon in linear time [J]. Discrete and Computational Geometry ,    
  29. ;;;          1999, 21:405-420                                                      
  30. ;;;      [8] Joseph O,Rourke. Computational Geometry In C [M].Second Edition.      
  31. ;;;          Cambridge University Press, 2004.179-181                              
  32. ;;;      ......                                  
  33. ;;;  ---------------------------------------------------------------------------;;;
  34. ;;;  Version revit See Command Routine .                                        ;;;
  35. ;;;  -------------------------------------------                                ;;;
  36. ;;;  Thanks Ribar.M from http://www.theswamp.org  for do many test              ;;;
  37. ;;;  Thanks Lee Mac, Jueao Sword, Charles Alan Butler for their Wonderful functions
  38. ;;;  -------------------------------------------                                ;;;
  39. ;;;  Discuss website : http://www.theswamp.org/index.php?topic=41837.0          ;;;
  40. ;;;  -------------------------------------------                                ;;;
  41. ;;;  Future Expansion : Support Island Case !                                   ;;;
  42. ;;;  -------------------------------------------                                ;;;
  43. ;;;  Any Advice will be welcome , Thank you !                                   ;;;
  44. ;;;  ---------------------------------------------------------------------------;;;
  45. ;;;  Statement :
  46. ;;;   1. When you use this program, all the consequences will be borne by yourself,
  47. ;;;      Please repeatedly check its correctness .
  48. ;;;   2. This program is only for exchange and information, not for commercial use.
  49. ;;;  ---------------------------------------------------------------------------;;;
  50.  

RAIN CODE

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #131 on: June 28, 2014, 03:39:45 AM »
I must say that when I first started Lisping back in 2003 I did not understand
the ownership of code. When collecting routines & subroutines I did not collect
the link to the source. This became a problem when I wanted to use the routine
in a posting of my own because often the author did not include a proper header
only a prefix on the defun name. The mistake I made was to include the
subroutine in my routine which I placed a header implying ownership. Fortunately
someone pointed out the error in my thinking (thank you MP) & I made an effort
to add headers to those sub-functions and links back to the source. This is like
foot notes in an article or book. So to omit these references is unthinking and
doing it regularly is rude behavior. I still have code floating around out in
cyberspace that I would like to correct but it is too late for most.
Once it leaves here you can not track it all down.

But now I make sure that any code I barrow has a reference to who or at least
where I obtained it so as not to IMPLY that I was the creator of the code. There
is a lot of effort and many late night study sessions that went into the ability
to create these routines that are so good that we want to reuse them rather than
create one of our own.

So honor that effort by including the proper header and or link back to the source.

I have been waiting for someone to say this...I echoed what CAB is saying.
The author have the right to demand his/her name be in the header and stay there with the lisp.

People like to copy others people lisp and then remove the author's name and they just use the lisp
without having to crack their head to write it. If you want to use the lisp at least leave the author's name there
and if the function name has the author initial please give the author the honor and respect and leave it there.

It is only few characters long no point of removing it to reduce to code size. If you are afraid of people saying that
why most of the subroutines are written by another person, then you should crack your head and write it yourself.

Becos it save you the time to write it then should give credits to the person who spent time to write it




RAIN CODE

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #132 on: June 28, 2014, 12:19:58 PM »
I want to correct one thing - my view is different from CAB.

I apologize to CAB for that.

« Last Edit: June 28, 2014, 12:32:39 PM by RAIN CODE »

ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #133 on: August 05, 2014, 06:32:24 PM »
Here are my latest codes referencing this topic...

Video can be found at Youtube...

http://youtu.be/FapqxIqQRv8

In attachment are all relevant routines used in this video...

Regards, M.R.

P.S. In some situations, 2droof-final.lsp may fail to produce correct and desired results, so be careful... Suggested is not to use sr.lsp until 2d solution made by 2droof-final.lsp is adequate (sr.lsp is using the same algorithm)
« Last Edit: August 10, 2014, 10:45:13 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #134 on: August 05, 2014, 10:03:19 PM »
Here are my latest codes referencing this topic...

Video can be found at Youtube...

http://youtu.be/FapqxIqQRv8

In attachment are all relevant routines used in this video...

Regards, M.R.

P.S. In some situations, 2droof-final.lsp may fail to produce correct and desired results, so be careful... Suggested is not to use sr.lsp until 2d solution made by 2droof-final.lsp is adequate (sr.lsp is using the same algorithm)
Nice work Ribar  :-)
Thank you for keep the head .

Is there problem in my last post version ?