Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 14
Posts: 14   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 24474 times and has 13 replies Next Thread
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9417
Status: Offline
Reply to this Post  Reply with Quote 
Re: Area calculation and auto dimensions for 2D

A nice start smile

The function that Puybaret told is private so i had to extract it and encapsulate it in the plugin
I pointed to you the getMeasuringDimensionLineAt method to give you hints. Nothing more and it's not a problem you copy it. You'll see that my development strategy is to generally keep many methods private. It's not that I don't want developers to call them, but exposing them as public would make them part of the API and oblige me to spend much more time to specify the best parameters.

The function needed the user preferences and the pixel length, but I couldn't manage to find a way to get them from the Plugin.
You can retrieve preferences with the Plugin#getUserPreferences method and pixel length with Plugin#getHomeController method. The later method returns a HomeController instance on which you can call getPlanController().getView().getPixelLength().

3.- I haven't found a way to separate the outer walls from the inner walls.
Look at RoomController class source code, the way walls surrounding a room are detected should help you. More generally, enumerating points with java.awt.geom.Area methods could be very helpful too.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 20, 2013, 4:33:51 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Sajmmon
Member



Poland
Joined: Nov 10, 2010
Post Count: 50
Status: Offline
Reply to this Post  Reply with Quote 
Re: Area calculation and auto dimensions for 2D

Nice plugin!
[Mar 20, 2013, 8:18:44 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
danielfranklinr
Newbie



Venezuela
Joined: Apr 5, 2012
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
Re: Area calculation and auto dimensions for 2D

Thanks Sajmmon!.

I've been working on the bugs Hans mentioned, so i would like you guys to try it again. Click Here to download the plugin.

Here are the details i've corrected from Hans:
When using variable wall thickness the dimensions behave in a strange way. If I change all walls to the same thickness, the problem disappears.

Now it doesn't matter the thickness of the walls it will correctly display the dimension lines.


A partial solution could be if:
a - you draw a large rectangle around your design, then select a number of walls. The dimensions of these walls are projected on the rectangle.
b - repeat if necessary.

Thanks for this hint, it is simpler when the user just select the walls that wants to have the dimension.


Also, I noticed that all dimensions are taken from the centre line of walls. Normally, in the Netherlands, dimensions are taken along the inside and/or outside of walls, and wall thickness is dimensioned separately.


Thanks to the tip Puybaret told me i managed to find the roompaths and display the dimensions correctly. At this moment the plugin adds both dimensions, interior and exterior.


Hans, i tried to test your files, but for some reason it says i dont have a recent version of sweethome. I tried them with the desktop version and applet version, and it was the same error. Maybe you are working in a new release that we dont have.



Both levels get dimensions;

I tried many times to replicate this error creating multilevel plans and i couldn't do it. If you are in the first level and activate the plugin it will put the dimensions to the selected walls, if you change to level 2 and activate the plugin it will erase the dimensions in level 1 and add the dimensions in level 2.


Round walls get strange dimension(s), see bottom left;

Im using the same code that Puybaret does, the button to add dimensions lines doesn't work correctly in the original version either. I assume it's because the curve is just a lot of straight lines with angles to make the effect.



If you save a project with dimensions, after re-opening clicking the button doesn't erase the dimensions. They have to be erased manually.

Yes, i don't want the users deleting other dimensions lines by mistake, but maybe I'm wrong and that will feel natural. In fact I was thinking to add a second button in the plugin, one to add the lines, and another to delete them, that way the user can add as many dimensions as possible without deleting them.


I'm still working in two important this right now:
1.- Ask the user if the dimension lines should be the exterior or interior or both. This will make the plugin to exclude the longest dimension (interior dimensions) or exclude all the dimensions except the longest (exterior dimensions). This will not always work but i dont have other ideas. I'm open to suggestions here.
2.-To get the dimensions I am cycling the walls, getting the middle point, and trying to get the dimensions from the roompath. While doing this no every dimension is found. I was thinking that instead i should cycle the roompaths, and from there find the point of the wall that intersect to get the dimension. I hope that Puybaret gives me some light in this point.


Hope to hear some feedback from you soon.
Thanks
[Mar 26, 2013, 9:34:49 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
hansmex
Advanced Member
Member's Avatar

Netherlands
Joined: Sep 26, 2009
Post Count: 3976
Status: Offline
Reply to this Post  Reply with Quote 
Re: Area calculation and auto dimensions for 2D

Saniel,

Thank you for the new version of the plug-in. I tested it using the same two files that I attached to my previous post. By the way, those files were created using a beta version of SH3D v4.0. My tests today were done using the installed version 4.0.

I notice the following problems:

- Round walls don't get dimensioned.
- When dimensioning vertical walls, one dimension is "upside down". It should be rotated 180 degrees, so that the text is legible from the same point of view.
- Often dimensions are too close and one will be on top of another one.
- When a diagonal wall is touched by a horizontal wall (see left example in the Test dimensions file), and you want to add a dimension to the diagonal wall, the horizontal wall also gets a dimension.
- It is not possible to add dimensions on more than one level.

To overcome some problems, I think it would be useful to add a second button to delete dimensions, as you already suggested. That way you can selectively add or delete the dimensions of the highlighted walls.

Again I suggest a different approach to this plug-in. Imagine that you draw a large box around your design. Outside the box come the largest (or exterior) dimensions of the selected walls, inside the box come the smallest (or interior) dimensions of the selected walls. It should be possible to automatically calculate the size of that box.

Hans
----------------------------------------
Hans

new website - under constuction
hansdirkse.info
[Mar 26, 2013, 10:30:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 14   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

  Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads  
© Copyright 2024 Space Mushrooms - All rights reserved