RC stairs macro

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: RC stairs macro

Post by three_d »

paullee wrote: Wed Jan 27, 2021 6:40 pm Indeed. But it seems it only happens when the Flight is not Straight, i.e. HalfTurnLeft or HalfTurnRight, probably seldom people use that at the moment :D

Maybe a bug in mantis for further improvement.
Hi paullee,
thanks for pointing it out! Anyway, this is an issue that needs to be fixed...but we can also experiment with other solutions.

hyarion wrote: Wed Jan 27, 2021 9:14 pm The reason I ask is that I don't think it's a good idea to merge features with known new bugs. It's generally better to fix those issues first, and then merge.
However, it is ok to leave old bugs, if that's the case, but then they should of cause be reported :)
Hi hyarion,
Yes, it seems a reasonable approach and I admit perhaps I've been a bit hasty to submit a PR.
hyarion
Posts: 139
Joined: Fri Jun 26, 2020 6:08 pm

Re: RC stairs macro

Post by hyarion »

three_d wrote: Thu Jan 28, 2021 10:15 pm Hi hyarion,
Yes, it seems a reasonable approach and I admit perhaps I've been a bit hasty to submit a PR.
Sometimes it is difficult to find bugs without a couple of extra eyes. Pull Request is a great tool for that :)

There's also a special type of pull request called Draft Pull Request that can be used if you want to start a discussion but doesn't feel that it's ready to be reviewed and merged. You can read more about this type here: https://github.blog/2019-02-14-introduc ... -requests/ (and it's also possible to change from/to Draft once a PR has been created if you wish)

Anyway, I think it's great work that you've done so far and I'm looking forward to see these final bugs to get squashed!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: RC stairs macro

Post by balrobs »

three_d wrote: Tue Jan 26, 2021 8:39 pm ....and helps and suggestions are always welcome!
Unfortunately I'm no coder and can only help by testing ... so that is what I did and found that modeling a half turn stair with a landing at the center gives an improvable result (see connection between landing and second flight in the following picture).
RC-Stair_01.JPG
RC-Stair_01.JPG (193.11 KiB) Viewed 2037 times
I searched the wiki and the forum to see if it's a known problem but couldn't find anything ...thus this post.
BTW I think this is an older problem and wasn't introduced by the recent tool improvements done by @tree_d.
Attachments
RC-stair.FCStd
(18.8 KiB) Downloaded 59 times
paullee
Veteran
Posts: 5074
Joined: Wed May 04, 2016 3:58 pm

Re: RC stairs macro

Post by paullee »

balrobs wrote: Fri Jan 29, 2021 9:10 am BTW I think this is an older problem and wasn't introduced by the recent tool improvements done by @tree_d.
Thanks for pointing this out, indeed not @three_d, that was me, when I started learning python and FC geometry (still learning). Maybe sometime need to attack this when there is a gap :)
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: RC stairs macro

Post by balrobs »

paullee wrote: Fri Jan 29, 2021 1:27 pm
balrobs wrote: Fri Jan 29, 2021 9:10 am BTW I think this is an older problem and wasn't introduced by the recent tool improvements done by @tree_d.
Thanks for pointing this out, indeed not @three_d, that was me, when I started learning python and FC geometry (still learning). Maybe sometime need to attack this when there is a gap :)
Thank you @paullee for your statement! Should I rise an issue on github/mantis so the task don't get lost?
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: RC stairs macro

Post by three_d »

balrobs wrote: Fri Jan 29, 2021 9:10 am Unfortunately I'm no coder and can only help by testing ...
Hi @balrobs,
Your work is as important as developing code....and thanks for doing the tests we needed for this issue.

... there I realized two minor issues:
1. when for flights Riser_Thickness>0 the connection points to the landings get messy
2. when for landings Riser_Thickness>0 FreeCad throws errors, the corresponding tree element shows an error symbol and no Riser_Thickness is applied to the landing.
With regard to the first issue, it was easy to fix.....I added only the following lines of code:

Code: Select all

	(....)

	(1245)
	  +		if obj.RiserThickness.Value > 0:
                  
	  +		   lProfile.append(vBase.sub(vRiserThickness))
	
	(....)

While the second issue, in my opinion, it appears more difficult to solve....maybe we should consider redefining the whole landing object.

solved1_issue2[resize].png
solved1_issue2[resize].png (141.58 KiB) Viewed 1944 times

hyarion wrote: Thu Jan 28, 2021 10:39 pm There's also a special type of pull request called Draft Pull Request that can be used if you want to start a discussion but doesn't feel that it's ready to be reviewed and merged....
Thank hyarion, I don't knew this tool.....and I found it very interesting and useful, particularly, I appreciated the fact that you can convert a pull request to a draft and viceversa at any time.

Anyway, I think it's great work that you've done so far and I'm looking forward to see these final bugs to get squashed!
I hope so too, thanks again!

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22960 (Git)
Build type: Release
Branch: master
Hash: c5a4b01d2e4218bcc0eb6650337650a6c65ef0e4
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
paullee
Veteran
Posts: 5074
Joined: Wed May 04, 2016 3:58 pm

Re: RC stairs macro

Post by paullee »

balrobs wrote: Fri Jan 29, 2021 2:24 pm Thank you @paullee for your statement! Should I rise an issue on github/mantis so the task don't get lost?
Feel free to do so.

And probably add a link to this thread and below thread in which I record most of the learning and development :D

Arch Stair - More Geometry Control? Profile Generator
paullee
Veteran
Posts: 5074
Joined: Wed May 04, 2016 3:58 pm

Re: RC stairs macro

Post by paullee »

three_d wrote: Fri Jan 29, 2021 4:02 pm Hi @balrobs,
Your work is as important as developing code....and thanks for doing the tests we needed for this issue.
Indeed, well said !
three_d wrote: Fri Jan 29, 2021 4:02 pm
... there I realized two minor issues:
1. when for flights Riser_Thickness>0 the connection points to the landings get messy
2. when for landings Riser_Thickness>0 FreeCad throws errors, the corresponding tree element shows an error symbol and no Riser_Thickness is applied to the landing.
With regard to the first issue, it was easy to fix.....I added only the following lines of code:
Looks cool 8-)
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: RC stairs macro

Post by balrobs »

three_d wrote: Fri Jan 29, 2021 4:02 pm ...
With regard to the first issue, it was easy to fix.....I added only the following lines of code:
...
Wow, that's very impressive too me! Only two new lines of code did that magic :shock:
I can only see two main reason for this: the existing code is well structured and you have a deep undestanding of it.
three_d wrote: Fri Jan 29, 2021 4:02 pm While the second issue, in my opinion, it appears more difficult to solve....maybe we should consider redefining the whole landing object.
Maybe you are right here and redefining the whole landing object would also allow us to improve it in such a quick and uncomplicated way. I think @paullee or @yorik are the right persons here to give us some advice :D
Thank you all for your efforts!
paullee
Veteran
Posts: 5074
Joined: Wed May 04, 2016 3:58 pm

Re: RC stairs macro

Post by paullee »

balrobs wrote: Sun Jan 31, 2021 9:31 am
three_d wrote: Fri Jan 29, 2021 4:02 pm While the second issue, in my opinion, it appears more difficult to solve....maybe we should consider redefining the whole landing object.
Maybe you are right here and redefining the whole landing object would also allow us to improve it in such a quick and uncomplicated way. I think @paullee or @yorik are the right persons here to give us some advice :D
@yorik is the master of Arch/BIM :D

That 'multi-segment' landing can be added with the Riser I think, @balrobs you have made an issue in github or Mantis, right ? Thanks :D
three_d wrote: Fri Jan 29, 2021 4:02 pm ...
With regard to the first issue, it was easy to fix.....I added only the following lines of code:
...
BTW, @three_d, if you have another gap, just note the Riser could even be looked better if it could consider the thickness of the Tread, so it extend slightly lower to the bottom edge of the below Riser :D

As @balrobs, it is indeed a great job. And hope more works can be done, though everybody contribute a small part, would make a great Arch/BIM I hope :D
Post Reply