1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative reference

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
wisecad
Posts: 92
Joined: Wed Aug 08, 2018 3:44 am

1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative reference

Post by wisecad »

Dear FreeCAD team/community,

First, let me thank you all for your efforts to make available a sorely-needed open-source software option for parametric 3D CAD.

- Introduction (you can skip this detail and go to directly to the problem section):
3D-printing is my hobby, and being that 3D-printing hardware and consumables can be a bit costly, I am interested in a free or relatively inexpensive software option for the design part of the hobby. For a few years I have used Sketchup-Make (Sketchup's free version). Sketchup is not a parametric CAD software but a polygonal modeler. Nonetheless, for the kind of designs I have produced this has not been a big problem. However, not long ago, Trimble (the company behind Sketchup) announced that they will no longer make available a desktop version of Sketchup-Make and will only produce a desktop version of Sketchup-Pro ($695). Instead, they have made available a web-based app called Sketchup-Free that does not offer many of the functionalities Sketchup-Make offered (e.g.: the ability to run extension/plugins). As a result, I started looking for a new 3D-design software.
Being that I am at a point where I would be learning to use a new software, I thought it would be a good idea to consider parametric CAD software. It would add accuracy and flexibility to my designs, and most offerings are very capable of handling polygonal meshes as well, so you get the best of both worlds. I narrowed my search to FreeCAD and Fusion360 (Autodesk offers a free license to small businesses and hobbyists/individuals). Fusion360 is really good, but again being that AutoDesk is an enterprise chasing the mighty dollar, they could pull the rug from under my feet in the future just like Trimble did just recently. As a result FreeCAD became my first choice, so I downloaded and installed version 0.17. Like me, I am sure there will be lots of current Sketchup-Make users that will look for alternatives and will give FreeCAD a try, so this is a great opportunity for FreeCAD to expand the user base.
Just finished reading the essential sections (1.1 - 1.3.5.4) of "FreeCAD - A Manual" (thanks to Yorik Van Havre and the FreeCAD community). So I decided to practice what I had learned on a simple design. Not a 3D-printing project but a carpentry one, consisting of a light-weight play-house for my daughter. That is when I ran into some behavior that I could not understand. I know and understand that FreeCAD is a FOSS effort, driven by the priceless effort of talented volunteers and development "It's done, when it's done!" I have no issue with that. I understand and expect wrinkles will be part of the experience at this point. Things like not being able to set the grid spacing for the draft-workbench in inches, even if the general system units are set to Building-US (ft-in/sqft/cuft), is not a big deal since setting it to 25.4mm increments will suffice. However the issue I ran into was a little disheartening, considering how excited I was after reading the FreeCAD manual.

- Problem:
Here is the problem. In trying to create a simple two-point rectangle using the draft-workbench in the X-Z plane, by entering the following coordinates: P1(0',0',0') P2(8',0',4') , using the relative-coordinates option for the second point. Doing so produces a rectangle that has a zero height. Please,seeee attached image. The height then has to be entered manually in the data section of the properties panel. Curiously, if I try the same process but with the checkbox for the second point's coordinates to be non-relative to the first point unchecked, in other words having the coordinates being absolute, then the rectangle is created with the intended height of 4 feet. From what I understand, since the first point is the origin P1(0,0,0), it should not matter whether the checkbox to make the second point's coordinates relative to the first point was checked or not. Furthermore, this problem does not arise when creating the same rectangle in the X-Y plane (P1(0',0',0') P2(8',4',0')); and as one would expect, checking/unchecking the checkbox to make the second point's coordinates relative to the first point does not matter.
I captured the python code produced in the console for clues as to what was happening. See below.

The following code results from creating a simple two-point (8' x 4') rectangle using the draft-workbench in the X-Z plane. The checkbox to make the second point's coordinates relative to the first point was checked. The result is not as expected. Notice how the height is a number (1.49308937752e-13) very close to zero.
>>> pl = FreeCAD.Placement()
>>> pl.Rotation.Q = (0.707106781187,-2.16489014059e-17,0.0,0.707106781187)
>>> pl.Base = FreeCAD.Vector(0.0,0.0,0.0)
>>> rec = Draft.makeRectangle(length=2438.4,height=1.49308937752e-13,placement=pl,face=True,support=None)
>>> Draft.autogroup(rec)

The following code results from creating the same two-point (8' x 4') rectangle using the draft-workbench in the X-Z plane. However, the checkbox to make the second point's coordinates relative to the first point was unchecked. The rectangle is created as expected. Notice how the height is now correct.
>>> pl = FreeCAD.Placement()
>>> pl.Rotation.Q = (0.707106781187,-2.16489014059e-17,0.0,0.707106781187)
>>> pl.Base = FreeCAD.Vector(0.0,0.0,0.0)
>>> rec = Draft.makeRectangle(length=2438.4,height=1219.2,placement=pl,face=True,support=None)
>>> Draft.autogroup(rec)

The following code results from creating a simple two-point (8' x 4') rectangle using the draft-workbench in the X-Y plane. The checkbox to make the second point's coordinates relative to the first point was checked. The rectangle is created as expected.
>>> pl = FreeCAD.Placement()
>>> pl.Rotation.Q = (0.0,0.0,1.53080849893e-17,1.0)
>>> pl.Base = FreeCAD.Vector(0.0,0.0,0.0)
>>> rec = Draft.makeRectangle(length=2438.4,height=1219.2,placement=pl,face=True,support=None)
>>> Draft.autogroup(rec)

Question:
Am I missing-something / doing-something-wrong or is this a bug? I surely hope I am missing something. If it is a bug this is the kind of thing that would put-off a newcomer from adopting FreeCAD.

Thanks in advance for your time and for your answers.

Cheers

Raoul
Attachments
Software-Freecad-Issues-04-DraftWorkbench-TwoPointRectangleTool-01.jpg
Software-Freecad-Issues-04-DraftWorkbench-TwoPointRectangleTool-01.jpg (922.12 KiB) Viewed 647 times
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: 1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative refer

Post by bejant »

wisecad wrote: Wed Aug 08, 2018 4:14 am Question:
Am I missing-something / doing-something-wrong or is this a bug?
Hi wisecad, and welcome here! Unfortunately, that's a bug.

Does anyone know if there is a ticket in the bug tracker for this, or if this is related to any other issue?

Confirmed using:

OS: Ubuntu 16.04.5 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.6712 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: da2d364457257a7a8c6fb2137cea12c45becd71a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

OS: Ubuntu 16.04.5 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.13528 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 5c3f7bf8ec51e2c7187789f7edba71a7aa82a88b
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

OS: Ubuntu 16.04.5 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.14220 (Git)
Build type: None
Branch: master
Hash: 1d81fd66b84af9ef8330ba1f1f6d1c5d6443f0c4
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: 1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative refer

Post by bejant »

And I suppose another bug is that the units (when creating the rectangle and afterwards as displayed in the Data Tab > Properties > Length, Width, and Height) do not display according to the user Preferences setting.

Edit: previously reported in: issue #1951.
Last edited by bejant on Fri Aug 10, 2018 10:09 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: 1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative refer

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
wisecad
Posts: 92
Joined: Wed Aug 08, 2018 3:44 am

Re: 1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative refer

Post by wisecad »

Thanks bejant and Kunda1 for your answers.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: 1st contrib. Intro 2 community. Question/bug-report? Draft-wbench 2-point rectangle 0-height when use relative refer

Post by Kunda1 »

@wisecad I really like your intro and hope you stick around. Participating in the community has a way of getting bugs fixed so I hope that encourages you to work through some of the 'wrinkles'. Another thing is if you are interested in Path then it may behoove you to run the 0.18 dev version of FC because of the fixes and features that are often added to it. The feedback of people testing potential fixes is also what drives development. So again I hope you stick around and continue to contribute your feedback and creating very thorough bug reports like the one above.
abdullah wrote:ping
@abdullah perhaps you'd have a chance to weigh in on this thread? Thanks in advance!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply