Building a bespoke staircase constructor plugin - need help

This topic has been viewed 10772 times and has 11 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Bubblobill
Posts: 77
Joined: Sun May 21, 2017 2:09 pm
Country: Australia

Building a bespoke staircase constructor plugin - need help

Post by Bubblobill »

So I have decided to try my hand at making a plugin. Unfortunately I have never programmed in Java before and it is doing my head in. I have made a fair bit of headway, the code can be found on Project on Github.

I'm fairly sure I have chosen a difficult project to cut my teeth on, what I need now is assistance and advice.
  • Have I approached this correctly?
  • Should I pack my bags and go home?
  • What should I do from here?


Anyone that wants to help out with the rest of the code is welcome to contribute.

Regards,

Jay
User avatar
dorin
Posts: 824
Joined: Thu Apr 24, 2014 9:14 am
Country: Vatra Dornei, Suceava, Romania

Re: Building a bespoke staircase constructor plugin - need help

Post by dorin »

For shore is a difficult project (at least for starting in any programming language).
Have I approached this correctly?

Depend of Your mind structure.
From my side (inspired by Asimov):
I know the final. For this I start with the end; what I want to happen in the end.
Than I think what I need for this, who provide'it (usually the end user).
I consider the user to be a most common person(over 65 old) who could use my soft; I keep this in mind and I try to make'it accordingly(specially the UI).
So, You have to reconsider the approach.
Should I pack my bags and go home?

NO WAY BACK!!! Get Up and fight!

Code: Select all

Anyone that wants to help out with the rest of the code is welcome to contribute.
Well not too much for the start:
1. I modify a little Your project. Could be find HERE
2. First observation on ApplicationPlugin.properties file:
field class MUST be the same as package from class files
3. Second= in src directory You must have .java not .class
You could see the differences in folder.
Happy programming [B-)] !
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law
Bubblobill
Posts: 77
Joined: Sun May 21, 2017 2:09 pm
Country: Australia

Re: Building a bespoke staircase constructor plugin - need help

Post by Bubblobill »

Cheers Dorin. Going to have a look at it now.
Jay
User avatar
dorin
Posts: 824
Joined: Thu Apr 24, 2014 9:14 am
Country: Vatra Dornei, Suceava, Romania

Re: Building a bespoke staircase constructor plugin - need help

Post by dorin »

One more inspiration on this site .
It do approximately what You want but You need to generate 3D objects not only flat.
So, could be a very long way.
I suggest You to start with more common stairs and than to add country specific restrictions.
Also You must decide the approach:
1. Do an plugin, or
2. Do an separate application.
While You don't need too much from SH3D You could choose the 2.
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law
Bubblobill
Posts: 77
Joined: Sun May 21, 2017 2:09 pm
Country: Australia

Re: Building a bespoke staircase constructor plugin - need help

Post by Bubblobill »

Nice find. I will see if there are things to adopt/steal.

I've been constructing a selection of parts to form the staircase and trying to work out how to get them into java. Manipulating them will be my next hurdle.

This is what I am aiming for in quality.
One step
Image

More steps
Image

Lots of steps
Image
Bubblobill
Posts: 77
Joined: Sun May 21, 2017 2:09 pm
Country: Australia

UI draft

Post by Bubblobill »

I have been beating my head against Java UIs and now it hurts.

Importing 3D objects and displaying them is proving to be beyond me so far so I have put it aside to work on the initial set-up interface. So far they should make sense to most people.

From SH3D I mostly want the user to select the levels that will contain the staircase. I use this to determine the total rise which influences the number of steps required, how many landings, etc.
Image

Basic step design is in prototype and looks like this
Image

Step rise selection will be limited (eventually) to integer divisions of the total rise.

I also intend to give alternative nosing profiles beyond the default half-round.

If anyone can give guidance on importing, resizing, positioning and displaying objects in a j3d display canvas I am all ears.
User avatar
dorin
Posts: 824
Joined: Thu Apr 24, 2014 9:14 am
Country: Vatra Dornei, Suceava, Romania

Re: UI draft

Post by dorin »

1. It's a good training to exercise with UI, You will need it.
2. An other source of inspiration could be useful. Read it and You will find also some regulations (riser height, recommended outcome, angle of the stair, etc).
3.
If anyone can give guidance on importing, resizing, positioning and displaying objects in a j3d display canvas

I suggest for inspiration to study the code of:
-Modify posture (SH3D)
-Modify opening (SH3D)
-Modify furniture (FurnitureLibraryEditor)

4. You will have also to generate 3D objects (read Export as new furniture & Shape generator plugins)
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law
Bubblobill
Posts: 77
Joined: Sun May 21, 2017 2:09 pm
Country: Australia

Technical question about level heights

Post by Bubblobill »

When I am determining the total rise for a staircase I am doing it based on the following calculation for spanning levels/floors.

Elevation[font=times new roman](Highest Level) [/font] + Height[font=times new roman](Highest Level) [/font] - Elevation[font=times new roman](Lowest level) [/font]

What I need to know is:
- Does Level Height include Floor Thickness?
- Does Level Elevation measure to the bottom of the floor or the top of the floor?

I think that for the last step to come out even with the floor I might need to adjust my formula to;

Elevation[font=times new roman](Highest Level) [/font] + Height[font=times new roman](Highest Level) [/font] + Floor Thickness[font=times new roman](Highest Level) [/font] - Elevation[font=times new roman](Lowest level) [/font]

but I am not 100%. I may just be overthinking it.
Mike53
Posts: 678
Joined: Sat Jan 06, 2018 1:02 am
Country: UK

Re: Technical question about level heights

Post by Mike53 »

Hi Bill
You may find some of the info Here helpful, it shows calculations for stairs 1 step down and with top tread level, plus many other things, i used it when calculating the stairs i have made.
I cannot help with the java wizardry, sorry, but good luck
Mike
User avatar
dorin
Posts: 824
Joined: Thu Apr 24, 2014 9:14 am
Country: Vatra Dornei, Suceava, Romania

Re: Technical question about level heights

Post by dorin »

About levels You could read this
- Does Level Height include Floor Thickness?
No.
Next level elevation=elevation+floor thickness+level height of previously level
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest