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

0 Members and 1 Guest are viewing this topic.

chlh_jd

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #150 on: July 01, 2018, 06:17:03 PM »
I think it's easy to solve the problem ,fowlling the pic. If I have time I'll try to solve it . Thank you !

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #151 on: July 08, 2018, 07:24:30 AM »
I wonder is that you replied chlh_jd...
E-mail : chlh_jd@126.com
no one responded...
I am wondering are you OK...

P.S. Also ymg replied once after long time of no response and then nothing... Wondering is he OK...
If mail is bad then what is correct one?
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

pedroantonio

  • Guest
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #152 on: July 13, 2018, 03:39:18 AM »
Hi   ribarm. I am  confused with all this changes. Can you post the final code ?  Is it possible to add a roof tiles hatch ?

Thanks

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #153 on: July 13, 2018, 06:50:21 AM »
Hi   ribarm. I am  confused with all this changes. Can you post the final code ?  Is it possible to add a roof tiles hatch ?

Thanks

2droof-final.lsp is final version... What I showed is that its not perfect - in 90% cases it should solve ridge lines, still with some complex polylines as references it may fail... The whole thing about this topic is to make you think and code your own solution... As I am not the author of posted lisp and its complex for me to understand it, I can't help further more with this code - I just pointed that there is a space for improvement... As for my version - it is for 3d lines, it uses offset (vla-offset) function and it also fails with complex solutions... Beside all this it quite slow - for DWG I posted it took almost 2 hours and then you had to remove some additional lines to get final roof solution after which I reconstructed 3d solid...
I can't post my version as I struggled to make it doing as it is doing solutions like it is for now - some additional lines had to be removed and some lines are broken - you have to reconstruct single from 2 or more collinear lines...
So maybe some day if I find it beneficial for me I'll post it... The thing for you to watch if you go following my steps is to know that offset command can make some lacks when complex roof is wanted, so you have to account for that and result may be correct but with additional not needed 3d lines...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #154 on: August 23, 2018, 02:17:57 AM »
Here are *.vlx files of my version... Still for some complex roofs you have to manually find solution and only then apply solution to 3DSOLID converter...
If someone is interested for lisp code though, you can make a small purchase - contact me at : ribarm@gmail.com
Still I am not sure that purchasing will work as I only have credit card viable for my country - Belgrade, Serbia, Europe...
We'll see, but here are *.vlx which are doing the same thing, only you can't modify them...

Regards, M.R.

[EDIT : I've changed a little main *.vlx (found some lacks)...]

[EDIT : I've changed my mind - who downloaded, its downloaded, now I am removing attachments... Only if I have response on my mail and concrete offer - maybe applications exchange or something else - I may post my lisps to him/her... Thanks for understanding...]

[EDIT : I thought ab this and I decided that I still want to be generous, so I'll attach again my *.vlx files... Since last time there have been changing in coding so this version is 3-4 times faster and it gives better results... Still it is slow in comparison to chlh_jd's code, but my version won't fail no matter how reference closed polygonal polyline looks like... Further more I did everything I could with current (vla-offset), so final return of execution of routine will always be with as much as possible lines that are relevant for solution (or solutions if there are more like roof-ultimate-test.dwg), so you always need to remove sufficient lines and leave only those that make solution you want... Afterwards when drawing is finished - solution, you can apply roof-mr-3dlines23dsolid.vlx converter in order to make 3d solid - of course for this CAD has to have implemented SURFSCULPT command... - there have also been slight change in this routine too - it's now little slower in converting, but it's better as far as my testings prove...]

[Previously attached files :
roof-mr-3dlines23dsolid.vlx
roof-mr-3dlines-convex+concave.vlx]

[*.vlx files removed for commercial reasons...]
« Last Edit: April 26, 2019, 06:56:13 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #155 on: September 13, 2018, 07:14:23 AM »
Hi, it's me again...
I see that everyone is having CAD installed with wrong offset algorithm and so you also have it wrong chlh_jd... I can only say that it's totally unnecessary to struggle with bad algorithm and try to fix what's apparently wrong in the routine that is using it as reference (my code), so someone has to take that step in coding new offset... I see that, apparently, if offset would yield good results, than on every polygonal LWPOLYLINE as reference - EXTRUDE - Taper option would also give what's supposed to - no apex 3d solid mess if extruding distance larger than top apex of tapered shape with some angle specified... Autodesk would have no problems in implementing new algorithm in command EXTRUDE... What I am saying is that no matter I posted bad *.vlx files, codes that I have now are 100% correct I've checked them many many times... And no matter if on some cases it could draw more lines that actually should be, you could then (if offset good) easily remove them - this happens only on one case I tested and that's when ridge lines are collinear with each others... So there is no solution even now for this task, your code has some problems with interference of ridges and my code with offset (vla-offset) to be more specific... So to fix this once for all, there should be working made on source of problem (cause should be fixed in order to make cure to all consequences that may rise afterwards)... I know that maybe I am just imagining, but I hope someone that have the knowledge by creating original offset could read this post and perhaps step into process of making new better algorithm based on old implemented one... First step would be to make it correct for polyline open/closed and only then take action further and implement it on other curves (circles, ellipses, splines and so...)... I'll attach picture of what I am thinking ab ultimate test and your image chlh_jd...
I hope my remarks would be considered maybe in forthcoming future and I can only hope that I am not so optimistic that someone could think that I am saying rubbish right now...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #156 on: September 13, 2018, 08:11:05 AM »
In attachment is dwg with I suppose correct offset...
M.R.

[EDIT : Attached additional dwg showing both solutions - this is what I gat on my slowest quad core PC after about half an hour...]
« Last Edit: September 15, 2018, 02:36:30 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #157 on: September 15, 2018, 08:24:27 AM »
Post updated here :
http://www.theswamp.org/index.php?topic=41837.msg589751#msg589751

One more thing, I've edited a little chlh_jd's routine so that it is little more reliable and I've shorten code for it didn't need repeating of one paragraph of codes - I've made (defun) of that and I called it when it was appropriate IMHO... So I'll attach my revision too, but still it can't solve roof-ultimate-test.dwg... Maybe someone else with more understanding of what's going on could do it better, but I'll stick for now with my sometimes 100 times slower version - vlx files posted in above link...

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

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #158 on: September 17, 2018, 03:28:43 AM »
Another one, maybe my 2droof-final.lsp is too bad...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #159 on: September 18, 2018, 08:42:57 AM »
611 seconds for this one with my *.vlx...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #160 on: September 18, 2018, 02:13:01 PM »
Actually I only now saw... Even my *.vlx couldn't solve this previously posted one... Red lines are manually reconstructed - they were missing...

[EDIT : I've corrected my *.vlx and reattached it again... It finished roof solution somewhat slower for 907 seconds, but it did the job...]
« Last Edit: September 19, 2018, 10:27:39 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #161 on: September 19, 2018, 01:26:02 PM »
Another one...
And I don't want to post more... Just for the one that can fix errors I think it's easy to draw and check until it's fixed... There is my *.vlx if you haven't noticed if something is too complex to figure out...
« Last Edit: September 21, 2018, 03:23:54 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #162 on: September 22, 2018, 08:32:10 AM »
Since I don't like to keep things in my library that aren't working as supposed to, I've played a little again with 2droof-final.lsp... All I did is quick fix in that "separated" (defun errf ( errn errm ) ... ) that now has 2 arguments both iterating so that every combination of planes is checked... Still it doesn't work in some cases, but in my last DWG - 42 secs.dwg it did the job... As this is quick fix and it is only good if pline don't have too many vertices (planes), you can try 2droof-final-new.lsp... In all other cases where you have too many vertices, don't even think of this - it may finish almost never and still when it finishes the result may be unpredictable... So for this cases (too many vertices) there is mod of it called 2droof-final-quick.lsp... But all in all my vlx - slower than 2droof-final-quick.lsp and in some cases quicker than 2droof-final-new.lsp (too many vertices) yields always the best possible from set reference polygonal closed lwpolyline... So I don't know, I tried again, but this 2d routine is too complex and seems unpredictable no matter its quick (quick version)... Still I think that this my last revision is somewhat better than previously posted lsp... I'll attach them both, and you do what you think is the best...
M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #163 on: September 24, 2018, 06:09:42 AM »
A little better formatted codes and some interventions... So latest revisions in this attachment...

[EDIT : For those that dowloaded - change (if (< loopn nnn) (progn ... )) to (if (<= loopn nnn) (progn ... ))
I'll reattach again...]

[EDIT : There was one more edit in the code... So now I think it's fine...]

M.R.
« Last Edit: September 25, 2018, 07:47:57 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: ==={Challenge}===Find the ridge lines of sloped roof
« Reply #164 on: September 25, 2018, 06:31:10 AM »
2droof-final-new.lsp slightly changed... Final touch...

[EDIT : Now it's all OK...]

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

:)

M.R. on Youtube