The new version is now available from my website
cabmaker32.com
You need to register and then you can download a trial.
The new version is now available from my website
cabmaker32.com
You need to register and then you can download a trial.
New DoorMaker Gold is now in testing.
Should be available for general download within a few days.
Version 1.0.36 – Dec 17, 2014
I have now coded the dynamic attributes into my plugin for bifold doors.
There was a gotcha that I wasn't expecting. It took me a lot longer to understand what was going on.
I started out just calling the script over and over to create up to 4 doors which handles a double bifold. Three problems, code was starting to get messy, execution was starting to take more time and memory and storage was increasing too much.
So I now create 1 door create a second instance then flip it. Then take the bifold (2 doors) and instance it and flip them. This caused havoc. As soon as I tried (in code) to change the axes of the second door the door no longer behaved as expected. Turns out that Rotz on the flipped door changed from 0 to -180 and all I did was flip the door.
Of course if you flip the door in the editor the rotz stays at 0.
tr = Geom::Transformation.scaling(sibling.bounds.center, -1, 1, 1)
sibling.transform!(tr)
If I change axes after flipping door then the door moved to an unexpected place. If I change the axes before flipping the door the axes gets flipped as well causing the door to move over.
The solution I came up with was to create a parent container to hold the door. Flip the door. Since the parent's rotz stays at 0 I could reference the grand parents angle.
Creating another level of nested containers effectively insulates the animate coding from the effects of flipping the door.
One other thing to note. If you want to leave the axis unchanged for the Door component then you need to change the math and take into account the relative X and Y values of the sibling. Unfortunately you need to reference the sibling.
Right
X =10.656250 * cos(-(RotZ)) - 0.870886 * sin(-(RotZ)) + Left!X
Y =10.656250 * sin(-(RotZ)) - 0.870886 * cos(-(RotZ)) + Left!Y
You can copy and flip for the door to open the other way. However, you can just change the axis and set the X and Y values for the Left Half instead of the Right Half.
Notice that all you do is negate the X and Y values (because the door slides the other way. You still reference the sibling (in this case the Right Half) if the parent axis is not set set the same as the Right Half axis.
Left
X =-10.656250 * cos(-(RotZ)) - 0.870886 * sin(-(RotZ)) + Right!X
Y =-10.656250 * sin(-(RotZ)) - 0.870886 * cos(-(RotZ)) + Right!Y
Jim that's got it.
I simplified the math through substitution which reduces the number of variables.
More importantly both right and left doors now reference parent directly. So now if a user renames a component the code doesn't break.
Yes - the construction guide was temporarily added along with the circles. Shows that the pivot point works as expected.
Just for interest sake (academia)
I'm guessing the solution for the flat model lies in the fact that the second doors x must be based on the pivot point radius to x which is offset from the actual x.
So - for a given rot value - x needs to be computed
perhaps a vector solution based on rot would work - I'm just talking out loud here - perhaps totally wet.
Jim - thanks a million
I can do nested - it makes more sense based on the complexity of the flat model.
Simpler is better.
I may need to ask you for some understanding - other than that - many thanks.
Testers found a few bugs that I am working through. I've also learned a bit and I believe that I will be able to handle opening and closing of bifolds.
The dowel is just to show you where the pivot point is.
That works - thanks.
The devils in the details - this is where I am going.
The pivot point is 35 mm from the edge of the door and on the center line.
The doors have a 3 mm separation (gap) when opened and are 3 mm behind the half jamb and the door is 3 mm away from the drywall edge.
When the door is open there is a bit of a separation between the doors ~3 mm.
OK - I've added a pivot point. This 1000 mm wide door has a pivot point at 300 mm
It is on the center line. Should be good enough.
Thanks Jim,
I think I get it.
It appears that the Left Door has its new origin on the right hand side of the right door
And the Right Door has its new origin on the left hand side of the left door.
What is a bit wierd is I set the angle to 93 degrees but RotZ only gets to 86.5
Sorry - I wasn't clear enough.
This is the movement I am after.
Right bifold section rotates 80 degrees
Left bifold section rotates 80 degrees and slides over
I want to get both sections of a bifold door to move together using dynamic attributes.
Is this possible?
The hinged section is simple - it's the second section that needs to pivot and slide that I'm not sure about.
Looks good.
A basic bifold door essentially uses a pivot hinge. The pivot is a small distance from one edge and on the center line. If a large door is to swing both ways then the pivot needs to on the center line. Doors that swing 1 way can have the pivot offset.
It appears that the top jamb is not rabbeted and if the door swings 1 way you can have the side jambs rabbeted opposite to each other.
If you have a door that swings both ways then side jambs are not rabbeted.
I have a number of scrambled files and a number of different projects.
I put several batch files on the desktop and run them every time I make a change to any of the rb files.
I put the files in a a public shared area so that I don't have to worry about virtual store with Windows 7 and so that I can place a single loader.rb file in many sketchup versions plugins folder.
This allows me to work with 1 set of files for SU7, SU8, SU 2013, SU 2014 and SU 2015
replace project_1 with your own project and file_1.rb with your own file. My batch files have up to 40 lines - takes about 2 seconds to run on my old computer.
c:\src\SketchUpRubyScramblerWindows.exe c:\src\project_1\file_1.rb
c:\src\SketchUpRubyScramblerWindows.exe c:\src\project_1\file_2.rb
xcopy "c:\src\project_1\file_1.rbs" "C:\Users\Public\Documents\Sketchup\project_1" /Y
xcopy "c:\src\project_1\file_2.rbs" "C:\Users\Public\Documents\Sketchup\project_1" /Y
xcopy "c:\src\InstallFiles\Sketchup\project_1*.png" "C:\Users\Public\Documents\Sketchup\project_1" /Y
xcopy "c:\src\InstallFiles\Sketchup\project_1*.pdf" "C:\Users\Public\Documents\Sketchup\project_1" /Y
xcopy "c:\src\InstallFiles\Sketchup\project_1\readme.txt" "C:\Users\Public\Documents\Sketchup\project_1" /Y
I can put a direction symbol like an arc and an arrow for 2D plans.
You are suggesting to put the direction information on a user defined named layer.
Please provide an example of what you would like to see for a direction symbol
That pivot hinge looks interesting. Looks like the door will complete clear the casings and can open 180 degrees.
This pivot hinge allows a door to open both directions.
If you could post a sketchup file with a door and a pivoting hinge I'll take a look at it. It seems to me that you would have to make changes to the door jamb.
Setting the pivot to a non 0 value for the actual door is the easy part. These doors support Interact. However I haven't figured out how to get the second part of a bifold to slide and open in conjunction with the first part just rotating through around 75 degrees.