tag:blogger.com,1999:blog-35682915632121350992024-03-05T15:21:38.671-08:00Amusements with FreeCADMr Parry's blog on his FreeCAD development.Unknownnoreply@blogger.comBlogger51125tag:blogger.com,1999:blog-3568291563212135099.post-22522683411059943482014-05-12T01:07:00.001-07:002014-05-12T01:07:29.720-07:00Drawing Updates<div dir="ltr" style="text-align: left;" trbidi="on">
I've returned from an interesting cycling vacation in Europe and if I can call myself rested, it helped provide me with a bit more energy to gear me towards getting the Drawing Module finished.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJCUd4nlY69esS3sTEr7pEBrWYqkqsfRkUXRMf3htU4fHcMFUgxTtnfoieJDbVjgTv7Dhfm2dmpIO00i_6Llyag-2WdObIXl4UyaO0ZA1ErEUOkYYUpddKdzaleSji5Pok-k92isADZ-s/s1600/new3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJCUd4nlY69esS3sTEr7pEBrWYqkqsfRkUXRMf3htU4fHcMFUgxTtnfoieJDbVjgTv7Dhfm2dmpIO00i_6Llyag-2WdObIXl4UyaO0ZA1ErEUOkYYUpddKdzaleSji5Pok-k92isADZ-s/s1600/new3.jpg" /></a></div>
<br />
<br />
With a steady stream of <a href="http://forum.freecadweb.org/viewtopic.php?f=8&t=6216">testing</a>, I have been ironing out some long standing issues, some hidden bugs and adding a bit more functionality. Fuelled by beer and eagerness to get this module complete, there's been some steady progress over the last week - or if deemed worthy a coding 'sprint'.<br />
<br />
There have been a substantial number of changes since last time, both visible and under the hood. I'll try my best to highlight the most important changes:<br />
<br />
With anything this creates new bugs and also helps discover ones hidden away. I think the philosophy is starting to come true: you complete 90% of your project in 10% of the time and the remaining 90 % of time is spent debugging the remaining 10% .<br />
<br />
<h3 style="text-align: left;">
New Features:</h3>
<h4 style="text-align: left;">
Drawing Icons</h4>
<div style="text-align: left;">
Drawing Icons are now used to represent objects in the drawing. Courtesy of Jim!</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Uo2vCvQ2TLUl2TZzktkPtz4_Mu0_vUEp3o11WrGjLP3xlJi2BU58udNL2OLIxu2Bi0H5TCapkRVTUKdxfHgwKqJaBNJ8n1zZklJhDhxUhJzC0RjFYh5Fy77EQcxEnpnMoy_1_rUFdoU/s1600/out2.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Uo2vCvQ2TLUl2TZzktkPtz4_Mu0_vUEp3o11WrGjLP3xlJi2BU58udNL2OLIxu2Bi0H5TCapkRVTUKdxfHgwKqJaBNJ8n1zZklJhDhxUhJzC0RjFYh5Fy77EQcxEnpnMoy_1_rUFdoU/s1600/out2.jpeg" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<h4>
Dimensioning tool bar</h4>
<div>
You may now select specific dimensions for your drawing</div>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAt9gejl3Jw6h-LeIkRMs1fTjoYkTfB4WZ9nc5jJGA30yuj40ZX_pdN7xAUnXo6-bqDZKAln10cY14ypg3EJnsM5nIo0PuroA-aqfrpgIa-9cBxLTtHlEdpyFaWujCi0p4mit_EcBzpWQ/s1600/out1.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAt9gejl3Jw6h-LeIkRMs1fTjoYkTfB4WZ9nc5jJGA30yuj40ZX_pdN7xAUnXo6-bqDZKAln10cY14ypg3EJnsM5nIo0PuroA-aqfrpgIa-9cBxLTtHlEdpyFaWujCi0p4mit_EcBzpWQ/s1600/out1.jpeg" /></a></div>
<h4 style="text-align: left;">
Diameter constraints</h4>
<div>
I recently added a diameter constraint which has various positional arrangements depending where you position the dimension label. </div>
<div>
<br /></div>
<div>
Centre mark option available for diameter and radius dimension</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjil8ZkkxoN2tkuKU4VZJJA-qoiUtkcV8kIzZEYWCDWe9XraFgXuB0Yj-gD8_I29nrzMwmxKCHS9N3eIA_1IG1DN4tqSS1YUhlWkxBHAGwHHKSDktSnrGl9guC9Q0wE-R0yWD21BVaDM90/s1600/out3.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjil8ZkkxoN2tkuKU4VZJJA-qoiUtkcV8kIzZEYWCDWe9XraFgXuB0Yj-gD8_I29nrzMwmxKCHS9N3eIA_1IG1DN4tqSS1YUhlWkxBHAGwHHKSDktSnrGl9guC9Q0wE-R0yWD21BVaDM90/s1600/out3.jpeg" /></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIzCbGt13F-Z7CKgtGxYYci9RoYHx9VYj3kS3YS_CT9FFFQiqhWSPPvwRTD02j8QtAiT_malkb8E7vztrhhxvfoVJc42HILiOsYrMrzAmp-CrqgByC0kqLAXSs1RPOY6SYQuHCD9QO1RM/s1600/out5.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIzCbGt13F-Z7CKgtGxYYci9RoYHx9VYj3kS3YS_CT9FFFQiqhWSPPvwRTD02j8QtAiT_malkb8E7vztrhhxvfoVJc42HILiOsYrMrzAmp-CrqgByC0kqLAXSs1RPOY6SYQuHCD9QO1RM/s1600/out5.jpeg" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<h4>
Drawing is updated dynamically when changing properties using property editor</h4>
<h4>
<br />Orthographic Task View Dialog:</h4>
<div>
Due to architectural changes,l the previous task dialog coded by Joe was difficult to incorporate with what I had done. The difference now is the way views are now handled positioning and views are managed with a container object (Orthographic projections) - this allows you to set the scale for each individual view and eventually the projection type. </div>
<div>
<br /></div>
<div>
These are automatically updated in real time. Along with this there are now three different scale types: 'Document' uses the page scale, 'Automatic' will attempt to calculate this automatically and also custom option. The latter two are available for all views.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnojtmrA7211rUyt3lfsJOECxsbbaEOjxa7iOgmrz4TrGLpEGvmQsvgYI4RaBIG-m9406D0gthAClFvaVv0qpaW7HGgA_Ktl1mE1_f0Gk-glidi8oyrVCJUUehWizBzpLH2R-NRLMkT68/s1600/out4.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnojtmrA7211rUyt3lfsJOECxsbbaEOjxa7iOgmrz4TrGLpEGvmQsvgYI4RaBIG-m9406D0gthAClFvaVv0qpaW7HGgA_Ktl1mE1_f0Gk-glidi8oyrVCJUUehWizBzpLH2R-NRLMkT68/s1600/out4.jpeg" /></a></div>
<h4>
<br /></h4>
<h4>
Undo & Redo now possible</h4>
<div>
Before this was a notable problem where it was never guaranteed that you could undo and redo correctly. It appears to work very well under most situations - even deleting items. The only issue I have seen so far is when deleting a dimension this isn't correctly positioned when you try to redo operation. </div>
<h3 style="text-align: left;">
Improvements</h3>
<div>
<ul style="text-align: left;">
<li>Select 'anchor' view and now correctly drags the group</li>
<li>Drawing dimensions don't recalculate every time they are moved.</li>
<li>Dimensions correctly positioned when you save and restore the document. </li>
<li>Reduction in number of document.recomputes - updates are automatically made. </li>
<li>Vertical and horizontal dimension is checks edges are not zero</li>
<li>When you create a page using the tool bar, the template is now loaded for the page (A4/A3) chosen</li>
<li>Tangent edges (e.g. cones, fillets) should now appear after disabling a check. Note: there is a limitation that these cannot be dimensioned</li>
</ul>
</div>
<h3 style="text-align: left;">
Reliability:</h3>
<div>
These are some recent changes this morning to try and prevent the random crashes/segfaults from occurring. As a result the bounding box also includes dimensions. I'm not sure if this is a good thing but I just need see if we still experience random crashes. This was a notable problem encountered in particular when you dragged a drawing view or more likely deleting a view. If I can get feedback on this over the course of time it'll help diagnose a better solution.<br />
<br />
There are more bugs out there some I'm aware of and some I'm not and to coin a nostalgia phrase we 'gotta catch em all'</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-77770889465682346232014-03-31T11:32:00.001-07:002014-04-04T00:59:29.270-07:00Testing the Drawing Module: Part 1<div dir="ltr" style="text-align: left;" trbidi="on">
<i>After initial round of testing, we discovered a re-occurring crash when you tried to open a newly created page. The result of last nights work this is now fixed. For those unfamiliar, in the FreeCAD_sf_master directory run 'git pull'.</i><br />
<i><br /></i>
<i>If you have any comments after testing the drawing module, please also consult this <a href="http://forum.freecadweb.org/viewtopic.php?f=8&t=6216">forum topic</a></i><br />
<br />
-------------------------------------------------------<br />
<br />
I haven't managed to do much recently. Work has snowballed and I've been having to work on a binary file converter for an Additive Manufacturing Machine. The experience from that I can imagine may be quite useful for writing and parsing other file formats if we ever need to in FreeCAD. I never would have thought I would read binary numbers as an engineer...<br />
<br />
It appears there is a demand for testing the Drawing Module. It's in the stage where I any testing would be quite helpful, mainly to get feedback on the user interface and push this into the master for testing. I am aware there are some deficiencies both in missing features and bugs, but I need some motivation to finish up the GUI to make it more user friendly. Input on this would be helpful. In particular GUI mocks - hand drawings on tissue paper are accepted!<br />
<br />
<b>Note: </b>Windows testers would be helpful!<br />
<br />
The idea of this post is to give a brief overview building FreeCAD to test out the Drawing Module.<br />
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">mkdir test && cd test</span></pre>
</div>
<div>
</div>
<br />
The run "git clone http:://repositoryaddress" like the below to clone my Github repository into your testing directory.</div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">git clone https://github.com/mrlukeparry/FreeCAD_sf_master.git</span></pre>
</div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<br /></div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
It should look like below. Cloning FreeCAD shouldn't take too long (it's about a 70mb download).</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA5Ljw-Zhf0GXKkWXiX1NzIL86CmFKu0EtpjxrcRh1R6PZuaXoM9DSj6FdyaPgvUPw4ejPaVQHJoOI_OkVzq82cWfn9LViJ9bsLtV0f01TV_oTOByVnR66fozLlulQNfaMDGqlO-baJ2Q/s1600/guide1.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA5Ljw-Zhf0GXKkWXiX1NzIL86CmFKu0EtpjxrcRh1R6PZuaXoM9DSj6FdyaPgvUPw4ejPaVQHJoOI_OkVzq82cWfn9LViJ9bsLtV0f01TV_oTOByVnR66fozLlulQNfaMDGqlO-baJ2Q/s1600/guide1.jpeg" /></a></div>
<br />
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<div>
<span style="font-family: 'Times New Roman'; font-size: small; line-height: normal;">Ensure you have the prerequisites for compiling and building FreeCAD - consult either the <a href="http://www.freecadweb.org/wiki/index.php?title=CompileOnUnix">wiki</a></span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
or if you are really ensure ask on the forums. </div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br /></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
You now need to checkout out the drawing branch </div>
</div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cd FreeCAD_sf_master && git checkout origin/drawing</span></pre>
<br class="Apple-interchange-newline" />
<span style="font-family: 'Times New Roman'; font-size: small; line-height: normal;">You should now be on the drawing branch in a detached state. </span></div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<span style="font-family: 'Times New Roman'; font-size: small; line-height: normal;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd739osvI0zyWork4SOKyJgKhTzZc3aUOchzCE1ojCST-2SkRQSqlgcUBVM5sjZTmD3AWKUfIfR_dilC16xcrCHHcQlM56JpNFldGQr0e9sWJ1YmheFdI3kGTsXopKk-FJFw-V6Q1w3KM/s1600/guide2.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd739osvI0zyWork4SOKyJgKhTzZc3aUOchzCE1ojCST-2SkRQSqlgcUBVM5sjZTmD3AWKUfIfR_dilC16xcrCHHcQlM56JpNFldGQr0e9sWJ1YmheFdI3kGTsXopKk-FJFw-V6Q1w3KM/s1600/guide2.jpeg" /></a></div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<span style="font-family: 'Times New Roman'; font-size: small; line-height: normal;"><br /></span></div>
<div style="background-color: white;">
Now we create a build directory outside of the source directory and then we configure using CMake</div>
<div style="background-color: white;">
<br /></div>
<div style="background-color: white;">
<div style="font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
You now need to checkout out the drawing branch </div>
</div>
<div style="font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18.479999542236328px;">
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cd ../ && mkdir build && cd build</span></pre>
<br class="Apple-interchange-newline" />
<span style="font-family: 'Times New Roman'; font-size: small; line-height: normal;">Now we build using CMake. The options that you pass may depend on your platform or distribution. If you have problems please consult the <a href="http://forum.freecadweb.org/viewforum.php?f=4">forums</a>. Configure the build using debug options for testing:</span></div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cmake - DCMAKE_BUILD_TYPE=Debug ../FreeCAD_sf_master</span></pre>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZT3z4VYS-noUwiYKRdyHqqUR07fbuRC8Cq4GrauL0TQHz4oC4YZuiUuOpcEzS7FZmzRk8qFN6jvhicC1tyUPni2rGAbE5TWXip03jPgLZLHKpjhF0-y9dTH6fKmtqvbDnOhQZ7VYxoQ4/s1600/guide3.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZT3z4VYS-noUwiYKRdyHqqUR07fbuRC8Cq4GrauL0TQHz4oC4YZuiUuOpcEzS7FZmzRk8qFN6jvhicC1tyUPni2rGAbE5TWXip03jPgLZLHKpjhF0-y9dTH6fKmtqvbDnOhQZ7VYxoQ4/s1600/guide3.jpeg" /></a></div>
<div>
<br /></div>
Eventually you should be configured and ready to build. All you then have to do is run make. To build faster, the option 'j' is the number of make jobs to run in parallel - set this to <b>CPU cores + 1</b></div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">make -j 7</span></pre>
</div>
<div>
The build procedure can take between 10-30 minutes depending on your computer specification. An SSD helps considerably more so than memory. Once built you can easily test FreeCAD without having to make an installation. </div>
<div>
<br /></div>
<div>
In the build directory you can simply run FreeCAD</div>
<div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">./bin/</span><span style="background-color: white;">FreeCAD</span></pre>
</div>
</div>
<div>
<br /></div>
<div>
<b>To use the Drawing Module change the workbench once you have a part.</b></div>
<div>
<br /></div>
<div>
<b>Part 2 to follow!</b> </div>
<div>
<br /></div>
<div>
<i>I think I will try and record a screen-cast for the next guide.</i></div>
</div>
</div>
Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-3568291563212135099.post-44494117121186490612014-03-15T06:16:00.003-07:002014-03-15T06:16:46.826-07:00Drawing Updates<div dir="ltr" style="text-align: left;" trbidi="on">
I am in the stage of trying to tidy everything up and get this baby into testing for you people to enjoy.<br />
<br />
I noticed that the drawing performance in QGraphicsView was becoming very slow especially if you tried to zoom in. It wasn't really obvious why but through investigation I noticed that this was because of a QGraphicsItemRectangle that was being used to render the blank page background. This was even with caching enabled and redrawing seemed to persist which was the cause of the performance penalty observed.<br />
<br />
The improvement I made was drawing the background page (a white rectangle) in the QGraphicsView drawBackground method. Instantaneously the performance was improved irrespective of zoom level. Everything comes at a price. The caveat was that we don't have a shadow for the background, but the main issue was very random segfaults. After hours of probing, it the cause was peculiar. An empty QGraphicsItemGroup was not updating its bounding box correctly. In short this got fixed with ample amounts of frustration. What is also nice is that much of the Drawing Canvas is cached so there should be little redraw slowing us down.<br />
<br />
As a result the performance is significantly better and the user interaction on my computer is smooth.<br />
<br />
I also was investigating the Task View created by Joe to see what can be used to create organised orthographic projections. Much of the functionality is built already in at a lower level except the automatic scaling. It's in all best interests to use code, but I am in the position where it might be easy to start with a simple interface that doesn't have all the logic embedded inside it. I'll post a topic on the forum for people's thoughts.<br />
<br />
Through this investigation, now in a collection of Orthographic views it has an anchor view which is used to move the whole group. It already feels quite intuitive to use. This was misleadingly obvious to implement and I started off using Qt's signal and slot mechanism but this was causing a reciprocal effect, whereby movement was exaggerated. After a few beers, I stumbled upon <span style="background-color: #f6f6f6; color: #363534; font-family: 'Open Sans', sans-serif; font-size: 11px; line-height: 13.199999809265137px;">QGraphicsSceneMouseEvent::</span>ignore() which allows a child items event to bubble through the child-parent hierarchy. To my surprise this work instantly and was also smooth.<br />
<br />
Getting bored one evening, I wanted to experiment and see if we could have user-editable text fields for the SVG templates, rather than the cumbersome Property Editor. To my surprise it's quite straight forward using previous code and using the text elements in the SVG document to create QGraphicsTextTtem which can be used very easily.<br />
<br />
Time for screenshot!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKSP1zCQZun4lgFljPQVCPBztORO-2kPvq_Ko9gUmclMzxp4c-TpZHAXGShAX-ulHEl6P53qLlSrhXV2KQ-ywG-ko4dlskyYJkDIGQoU6hhFxPnhll7e6IVbw8pfyechyphenhyphen1JykOb8QEmnc/s1600/svg.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKSP1zCQZun4lgFljPQVCPBztORO-2kPvq_Ko9gUmclMzxp4c-TpZHAXGShAX-ulHEl6P53qLlSrhXV2KQ-ywG-ko4dlskyYJkDIGQoU6hhFxPnhll7e6IVbw8pfyechyphenhyphen1JykOb8QEmnc/s1600/svg.jpeg" /></a></div>
<br />
The picture above is a culmination of what's been done. The text block on the right were edited in the document. All that needs to be figured out is if people are happy with this and a mechanism for storing the data fields more intuitive than an array. </div>
Unknownnoreply@blogger.com13tag:blogger.com,1999:blog-3568291563212135099.post-4093681257114003122014-03-01T04:36:00.001-08:002014-03-01T04:36:20.948-08:00SVG Export in Drawings<div dir="ltr" style="text-align: left;" trbidi="on">
I was intending to blog last night about this, but two beers afterwards and I fell asleep - typical.<br />
<br />
The focus now is trying to get the Drawing Module in a usable state, so that people can use it and begin testing. It's unlikely to be in the next 0.14 release, but I would definitely want to see it within the git master so that it can be test and used by the more enthusiastic users.<br />
<br />
The remaining pieces of work are exporting the drawing. Last time, I worked on getting SVG templates working. The only issue remaining with these is that they are not automatically redrawn until you update Page properties. I also changed it so that templates provide information about the Page such as the size and orientation, so these don't have to be arbitrarily set by the user.<br />
<br />
I previously mentioned a while ago by using QGraphicsView we can export to a few vector formats for free. This includes PDF, Postcript and also SVG. This is only a temporary measure but is actually very useful to obtain near exact representation of the Drawing shown in the GUI. The limitation is that FreeCAD must be compiled with a GUI to get export functionality. I plan to have a separate Exporter class that will provide an interface for exporting into multiple formats.<br />
<br />
There are a few issues with the ViewProvider classes where currently they are not very friendly with any view that isn't a Coin3D view. For the time being the only way to access the SVG export functionality is right clicking the drawing page and clicking on 'Export SVG'. There isn't a way to expose this in the FreeCAD navigation.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFLsopTJ9duvAEJb9SbwwkHcKeHjt72kZv2UUk8cXfCYXD5Eu1wEDQVcWHUKnE5PzrQ_kz3EUIr8cTMHqaZOVywgw5_ioqWFhhjVJrEE24uaOtY-NitMVk4KkO_WMziEBJ3hi3z_xBw8/s1600/exportSVG.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFLsopTJ9duvAEJb9SbwwkHcKeHjt72kZv2UUk8cXfCYXD5Eu1wEDQVcWHUKnE5PzrQ_kz3EUIr8cTMHqaZOVywgw5_ioqWFhhjVJrEE24uaOtY-NitMVk4KkO_WMziEBJ3hi3z_xBw8/s1600/exportSVG.jpeg" /></a></div>
<br />
<br />
Export to SVG from QGraphicsView is pretty easy, it's just the case of using QSvgGenerator and passing this to QPainter and then passing this to the render method inside a QGraphicsView object (<i>m_view</i>)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhzQNpA3t21kAU1KslOJTNWiMczS59P4S3K7JI_HR7Mf0y5A324uzmUNdX1dxP4OSQ_n_gKPfpTIFu_cR8LwEClgGbHDsfErXkHSLHmN4Gi1NezqfK5Y8-BJzU32JhxyzTlmD1J2TITtM/s1600/exportSVG1.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhzQNpA3t21kAU1KslOJTNWiMczS59P4S3K7JI_HR7Mf0y5A324uzmUNdX1dxP4OSQ_n_gKPfpTIFu_cR8LwEClgGbHDsfErXkHSLHmN4Gi1NezqfK5Y8-BJzU32JhxyzTlmD1J2TITtM/s1600/exportSVG1.jpeg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The Drawing View class manages at a high level the QGraphicsView. The CanvasView (m_view) is the lower level and provides the higher level drawing functionality. CanvasView has two modes to toggle editing. When it is disabled it removes borders, vertices and also cosmetic lines which keep the same thickness regardless of zoom level.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The issue I was having was that the toggleEdit method wasn't working correctly. The output in the SVG file was raster for some reason. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8qBnV2slYQIGTnaiiCLNWRL-YtXVbUsh1oYVEQBz7dqpfcVYkkUaRalpipwBSwDsRE0xyjkZR9v2hf9mj1VDkW-aaPIVYOI-FPCMCFAWOFOsLpzwDSmaeV4tTs6mZklqR0ZMK5Rh45Gk/s1600/exportSVG2.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8qBnV2slYQIGTnaiiCLNWRL-YtXVbUsh1oYVEQBz7dqpfcVYkkUaRalpipwBSwDsRE0xyjkZR9v2hf9mj1VDkW-aaPIVYOI-FPCMCFAWOFOsLpzwDSmaeV4tTs6mZklqR0ZMK5Rh45Gk/s1600/exportSVG2.jpeg" height="197" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I knew this was a caching issue but I wasn't entirely sure where it was happening because I explicitly set this to be turned off when out of editing mode. After many hours of searching, this problem was being caused by one line. So the result is below:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnTyt9Z7nRGjpNtdfV3D5UZDjsWlejUeCPezLoxc-um97TnagasTwLcMZ3L4MUX2QfbGGphNzWqcAjktFZki4LRtT6y6RWI9syYuA3UHOw8xvcr6po-ce1An00tg2juidoLAuoUHMGspY/s1600/exportSVG3.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnTyt9Z7nRGjpNtdfV3D5UZDjsWlejUeCPezLoxc-um97TnagasTwLcMZ3L4MUX2QfbGGphNzWqcAjktFZki4LRtT6y6RWI9syYuA3UHOw8xvcr6po-ce1An00tg2juidoLAuoUHMGspY/s1600/exportSVG3.jpeg" height="342" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
On the left is the exported Drawing opened in Inkscape. The right is the Drawing Module. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Spot the difference: </u></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul style="text-align: left;">
<li>The arrow heads, which are drawn as triangles rather than SVG line end styles.</li>
<li>The SVG template losing colour for some reason.</li>
<li>The font for the dimension datum labels are different, because <i>osifont</i> isn't installed locally on my computer.</li>
<li>The drawn primitives within the SVG document are not grouped. </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: left;">
<i>Note: this will be a fail safe option because we don't have any control on the output at all. For example it would be useful to have groups in SVG to separate views.</i></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-3568291563212135099.post-10136442805052317202014-02-19T16:18:00.002-08:002014-02-19T16:18:38.919-08:00The Return of SVG Templates<div dir="ltr" style="text-align: left;" trbidi="on">
After some discussion, there was a little re-think and it seemed a good idea to allow different templates to be used. Despite my focus on creating a parametric template, SVG templates are a reliable solution and have done well in the past.<br />
<br />
My previous efforts was adapted to allow different template features to be used and it was fairly trivial to make the SVG template work. There was a lot of code duplication from the previous version which made things even easier without any loss in functionality infact. However it did need a fair few tweaks to get working.<br />
<br />
The main change involved parsing the SVG document to obtain the width and height attributes for the document. The problem that I was having was the SVG document didn't share consistent units. What was interesting was using the new Units Framework to parse this, so in theory we shouldn't be restricted to just metric units for templates.<br />
<br />
<b>Here's the result:</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwHfXkSmaDHpDkuchsxQBqMkMExmuDtO4QNsf4jAeMItT0OxBQOtH4ae_CZCBPj4QJPwRIrKuC5eWikZ-VzmhQHn8UWsIO-FsKLhKxWsXxIqyHvDZoei70AhFHu53qT3cY1TE1HSwLSX8/s1600/svgtemplate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwHfXkSmaDHpDkuchsxQBqMkMExmuDtO4QNsf4jAeMItT0OxBQOtH4ae_CZCBPj4QJPwRIrKuC5eWikZ-VzmhQHn8UWsIO-FsKLhKxWsXxIqyHvDZoei70AhFHu53qT3cY1TE1HSwLSX8/s1600/svgtemplate.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5e-qhGPPl2E7QVw5ltoYaESXsbaBaIuGNNLN1wCuuPLX3ziBR_31_zfUYqn1o6m6Xme0QAGhM64eq9yHWjddY8TjLlqAWUhJz91KJk3VfPylTGR7SDKcfVwWSrzY_qstlM9JNRsBGwI0/s1600/svgtemplate1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5e-qhGPPl2E7QVw5ltoYaESXsbaBaIuGNNLN1wCuuPLX3ziBR_31_zfUYqn1o6m6Xme0QAGhM64eq9yHWjddY8TjLlqAWUhJz91KJk3VfPylTGR7SDKcfVwWSrzY_qstlM9JNRsBGwI0/s1600/svgtemplate1.png" height="295" width="400" /></a></div>
<br />
<br />
The title block holders currently don't work at the minute. Anyway there's still more to work to do but it's starting to take shape quite nicely once again.<br />
<br /></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3568291563212135099.post-31942628365245454602014-02-07T15:34:00.002-08:002014-02-07T15:34:57.763-08:00Beginning of parametric (python) templates in the Drawing Module<div dir="ltr" style="text-align: left;" trbidi="on">
It's been a passing since the last entry. Unfortunately I've run out of beer and the fridge is empty, so tea again will suffice for a quite casual evening in programming.<br />
<br />
After some <a href="http://forum.freecadweb.org/viewtopic.php?f=8&t=5232&start=90">discussion</a> on the forums, I think I eventually persuaded everyone that SVG templates are simply not right for the job. Admittedly it's a nice standard and is great for customisation and has worked very well in the previous version available in FreeCAD. It also allows easy customisation and post-editing with other graphical editors such as Inkscape. In fairness, Inkscape was not built for this job, even if there are several attempts at adding CAD functionality into the mix.<br />
<br />
<h3 style="text-align: left;">
The problems using SVG for templates as I see it:</h3>
As far as I'm aware it's not adopted by any Mechanical CAD Package. I won't get into the discussion, but the biggest problem with using this template format is that there is no easy way to translate this into other formats such as .dxf, .dwg (Autocad / Teigha) or even our own representation if we ever needed it.<br />
<br />
Dealing with XML is not impossible, and can be quite easy to manipulate using DOM (Document Object Model) functionality built into Qt. However, interacting with it through QGraphicsView is not great even if we have QSvg - which is apparently now obsolete. The other original idea was to parse any text fields and turn these into editable text boxes, but this alone creates further impracticalities.<br />
<br />
The other big problem that seemed to be happening was the size and variation between templates based primarily on the paper size and the standard used (ANSI, ISO, Arch). There is nothing stopping someone creating these but in the future if these maintained it creates a lot of duplication of work.<br />
<br />
I decided that we might as well do it RFT (right first time) rather than wait after the maiden release of the new module, which could be later in the year now.<br />
<br />
<h3 style="text-align: left;">
Parametric driven templates</h3>
The combination of having endless combinations of templates was impractical. Some professional Mechanical CAD systems actually have limited number templates available. Instead, there was an attempt to to generate the SVG template using a python script. In the end. the best solution is to use a customisable python script to automatically generate the geometry, text fields and other extras for the template.<br />
<br />
This script runs each time page dimensions change and is passed important properties such as page type, width, height, fields required and can create the frame, title blocks and so on, to the user's liking. I'd envisage an interface panel for customising this.<br />
<br />
Any template geometry, fields etc. are abstract entities and are stored within the document feature. This can be then easily processed by an export script to be usable in different file formats.<br />
<br />
Having abstract types allows isolation of individual elements in a template much easier. Practically this means if a text field is created, a text editing place holder is created and can be more easily manipulated. The same will go for Template annotations which still need work.<br />
<br />
The only problem with this method, is we are somewhat restricted to the drawing functions and data types implemented. This might be lines, rectangles, arcs, text. Some CAD programs allow their sketch functionality to be used on top of their drawings. In some cases it can be quite useful, however, considering the maturity of the module, I don't think is appropriate or demanded.<br />
<br />
I'll shut up now and show a picture.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglFMRXVodOEVB3wnpTBQdH4kYlsaucNGNV0k-W2LkreGf1vXNARZZlGzI9GU3liUgtlxBr7F5JZQt5zl6XfLjb2B_BrOnxfSzdP3-O7o8rZCcoSUXQq6NMuPe3vKIPFLdgABnZCZPFmZ0/s1600/template.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglFMRXVodOEVB3wnpTBQdH4kYlsaucNGNV0k-W2LkreGf1vXNARZZlGzI9GU3liUgtlxBr7F5JZQt5zl6XfLjb2B_BrOnxfSzdP3-O7o8rZCcoSUXQq6NMuPe3vKIPFLdgABnZCZPFmZ0/s1600/template.png" height="616" width="640" /></a></div>
<br />
<br />
This is a square page with a isometric view on it. Those lines across the page were created using<br />
<br />
App.ActiveDocument.Template.drawLine(x1,y1,x2,y2);<br />
App.ActiveDocument.Template.touch()<br />
<br />
I'm still not sure yet how to organise the script so it knows about Template. However, this is to just show it working. I'm looking for people who can parametrically create a nice python script for generating scripts - don't expect me touching python!<br />
<br />
<h3 style="text-align: left;">
Dimension Placeholders:</h3>
<div>
Some people will like this. From a solidworks background you can use custom placeholders for dimensions/sketcher datums. It's quite neat and allows some customisation where you may need it. </div>
<div>
<br /></div>
<div>
For now my implement uses placeholders where there is a content field and the placeholder %value is the datum size.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDSG9qq8bDPuY0VUIm9oP2eaF1yoi_Z5RZmevZh1TQFviBrlAp_vGh-oAu_ySLrLF5MJqbhwZUYI9GTEPkDBAWtUuwELXjnXS4rgnmV8-RwS4C1tTojRLaMknBtOInhF773nOL9hkmBIk/s1600/dimensionlines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDSG9qq8bDPuY0VUIm9oP2eaF1yoi_Z5RZmevZh1TQFviBrlAp_vGh-oAu_ySLrLF5MJqbhwZUYI9GTEPkDBAWtUuwELXjnXS4rgnmV8-RwS4C1tTojRLaMknBtOInhF773nOL9hkmBIk/s1600/dimensionlines.png" height="498" width="640" /></a></div>
<div>
That's all for now folks!</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-58929191742396783582014-01-19T16:24:00.001-08:002014-01-19T16:24:19.288-08:00Updates to the Drawing Module<div dir="ltr" style="text-align: left;" trbidi="on">
I'd promise to get some wrote by the end of the week, so here's my attempt on covering updates I have made to the Drawing Module over pretty much the last half of the year.<br />
<br />
In general there's been a lot of incremental small fixes that have accumulated over such a long time, which is a stark contrast when I look at the last blog post on this and might seem significant.<br />
<br />
One of the big changes was adding initial support for drawing the page background given the width and height and recently spending time switching the origin of the coordinate system to the bottom left with the y-axis pointing upwards - see this <a href="http://forum.freecadweb.org/viewtopic.php?f=10&t=5378">post</a>. QGraphicsView orients with the y-axis pointing downwards which is also used in SVG. It's a trivial fix, where the y coordinate is inverted for the position of every Drawing Views. This is needed to ensure consistency with CAD packages and other formats.<br />
<br />
The next step for improving the functionality is adding support for templates and displaying this on the background.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNHPc-Md8Zfght3Y69sj562-jX2cnOrZ1gUBRhs1ayoRMXLfGaa2xOnJI8DbiAAb0ROlawPD52_6ZOAMW4zuFHXXTU5ep3TZEt6RhesYaWN-yvGDawpFXs1X4IAH3Sms7a5XAfWyW4C3s/s1600/snapshot1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNHPc-Md8Zfght3Y69sj562-jX2cnOrZ1gUBRhs1ayoRMXLfGaa2xOnJI8DbiAAb0ROlawPD52_6ZOAMW4zuFHXXTU5ep3TZEt6RhesYaWN-yvGDawpFXs1X4IAH3Sms7a5XAfWyW4C3s/s1600/snapshot1.png" height="375" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
These leads onto talking about further work on improving the dimensions. The most obvious detail is the improved presentation of dimensions. There are now arrow heads, which later will be allowed to be changed to a few standard ISO options and the use of a font called <a href="https://code.google.com/p/osifont/">osifont</a>, which I was recommended for a starting point for datum labels. The license needs checking as it appears to be GPL 3 - I'm not entirely sure if this is compatible for distribution directly with the FreeCAD release but in the worst case an be installed separately by the user or made a dependency on the packaging front and be used if available by default.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5X7k8euhJg164bY4mwEeTgxRclQl9ajvon8Fy9UDaw9CcN5mxgEmd6iWbcSWOtSbC0X9BtjeFna2h-S15ZmajinB0U-8XGT-5byPj_UoUxEgYmdc8JwJ8wEcylc4XXl1EN690JC2Ve4Y/s1600/snapshot2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5X7k8euhJg164bY4mwEeTgxRclQl9ajvon8Fy9UDaw9CcN5mxgEmd6iWbcSWOtSbC0X9BtjeFna2h-S15ZmajinB0U-8XGT-5byPj_UoUxEgYmdc8JwJ8wEcylc4XXl1EN690JC2Ve4Y/s1600/snapshot2.png" height="534" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The datum values can be used calculated as project or as true values - if an orthographic projection is used then projected values are used by default. The leader lines are also calculated to the end points of the lines avoiding any overlapping. The dimensions also use caching and now don't need to recalculate when these are moved on the canvas by the user. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIibq4H2AYI6cF2A8OaD_5sjYuKOupiL5C3HxUTPJL16eOwl8wEFNl40OfUpQZPVDKKgRNJSguKORRD2vJxV7c1O5L6Y0C4QMH5Pp3vmZZsINexgxE4_ed6lZmo0oyBGLeoiQ22zVYWhY/s1600/snapshot3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIibq4H2AYI6cF2A8OaD_5sjYuKOupiL5C3HxUTPJL16eOwl8wEFNl40OfUpQZPVDKKgRNJSguKORRD2vJxV7c1O5L6Y0C4QMH5Pp3vmZZsINexgxE4_ed6lZmo0oyBGLeoiQ22zVYWhY/s1600/snapshot3.png" height="258" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
There is now an orthographic container, which contains ortho-views -orthographic projections such as front, left, top etc. These benefit of having a container is that the child orthoviews are much smarter and allow various properties such as scale or the type of projection (first or third angle) to be set from the container which are then cascaded down to the child views. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
QGraphicsView is quite flexible and allows some nice interactivity too. A little feature I implemented was having alignment between views: and can be interactively moved along one axis. You can seen in the screenshot from above the are all aligned correctly. This originally took a while to figure out because the projection used in the current release of FreeCAD is not consistent - the simple trick was ensuring that the centroid of the part is used as the origin of the projection plane. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJIzXoujRw1TPNGxQilzm4_THaKX1Iiw7TIgWo5QlutRqkMBbwjKPbhUzW5Dfh5OrOf7BUz4GGm7R20z59zSDl0KrvR_6UeqVwf5qZx8ShyTt6Q0lj-AJNf9tRfBwE1WX457_iPb_gGQw/s1600/snapshot4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJIzXoujRw1TPNGxQilzm4_THaKX1Iiw7TIgWo5QlutRqkMBbwjKPbhUzW5Dfh5OrOf7BUz4GGm7R20z59zSDl0KrvR_6UeqVwf5qZx8ShyTt6Q0lj-AJNf9tRfBwE1WX457_iPb_gGQw/s1600/snapshot4.png" height="400" width="262" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Another little feature I added was support for angles - although there are a few cases where an exception is thrown. The final thing I currently can think of working on is improving the print support which is slowly getting there:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT_AJBBpJUpCeVTAuxj1TGAX-Cx5idYA4W-a9gf0r6GfP10eW6NYUMecX9c6_cBKF6GLHZ29mXX1xF08JQQdCr-QJTSTv48HcNOToFHASEv4I0AaOCKoKn06OFvZj0IHgT83ljCrYhP3I/s1600/snapshot5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT_AJBBpJUpCeVTAuxj1TGAX-Cx5idYA4W-a9gf0r6GfP10eW6NYUMecX9c6_cBKF6GLHZ29mXX1xF08JQQdCr-QJTSTv48HcNOToFHASEv4I0AaOCKoKn06OFvZj0IHgT83ljCrYhP3I/s1600/snapshot5.png" height="315" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Anyway that's an overview and hopefully give some incentive to give the drawing branch another try!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
Unknownnoreply@blogger.com12tag:blogger.com,1999:blog-3568291563212135099.post-74946414219799126912014-01-13T15:59:00.002-08:002014-01-13T15:59:21.042-08:00I'm back!<div dir="ltr" style="text-align: left;" trbidi="on">
I took some time of for the later part of 2013 for an adventure that in the end didn't work out. Boo hoo!<div>
<br /></div>
<div>
Now I'm returning back again for 2014 for the foreseeable future! I'm pleasantly surprised to see that people are still actively looking at the pages - despite the inactivity since May and it's remarkable how time has flown. Anyway, let me introduce the new year with some good news.</div>
<div>
<br /></div>
<div>
From last December, I am now a Postgraduate Research student at the <a href="http://www.3dp-research.com/">EPSRC for Innovation in Additive Manufacturing</a> at the University of Nottingham. (This means I'll be working for a PhD over the next three years). It is a great opportunity to be doing particularly ground breaking research here on various areas concerned essentially with commercial 3D printing and eventually become an expert in this revolutionary field. </div>
<div>
<br /></div>
<div>
As with all academic research this is non-proprietary, so in theory the modelling techniques that we are aiming to develop may reach into programs such as FreeCAD.<i> I'll later give a brief overview of what we do here now I'm familiar with what projects have been taking place</i>.</div>
<div>
<br /></div>
<div>
I'll later incorporate other posts into this blog related to my research but not exclusive to FreeCAD that might be of interest to some readers. Later on I hope to apply some experiments too. </div>
<div>
<br /></div>
<div>
So where do I position my self now with FreeCAD? Admittedly these days, I don't have as much time as an undergraduate during the day, but I now have blocks in the evening where I can sufficiently give time to work on it as I choose. </div>
<div>
<br /></div>
<h3 style="text-align: left;">
Drawing Module:</h3>
<div>
My focus is to tidy up the work that I've done over the past year on the new Drawing Module and get it into a 'playground' state where interested users can test and use it with the strings attached that non-critical bugs exist.</div>
<div>
<br /></div>
<div>
Later on in the week I'll try and write up an update of where I currently am with the Drawing Module - obviously with pictures!</div>
<div>
<br /></div>
<div>
The current big show stoppers in terms of stability and usability are the following:</div>
<div>
<ul style="text-align: left;">
<li>Random Draw Crashes (rare)</li>
<li>Random segfaults (rare)</li>
<li>Some projections are missing (tangent curves in particular)</li>
<li>Dimension of edges lose their position randomly (Bug with OpenCascade)</li>
<li>Background template layer non-existant</li>
</ul>
<div>
Note to people: There has been many substantial changes since May. Feel free to check out the git repo - <a href="https://github.com/mrlukeparry/FreeCAD_sf_master">Drawing</a> branch and try it out! </div>
<div>
<br /></div>
<div>
If you can find some solid test cases for the above in particular that would be very helpful :) </div>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-13552675393349109582013-05-31T02:12:00.000-07:002013-05-31T02:12:45.917-07:00Exams are finished<div dir="ltr" style="text-align: left;" trbidi="on">
Yesterday was a momentous occasion. Completing my last exam, I have now finally completed the four years of my degree studying Mechanical Engineering. I guess that's party time for me!<br />
<br />
With the unpredictable and quite volatile nature of British weather, there are bound to be a few days that will be pouring with rain, hence an opportunity for further work on getting this drawing module completed.<br />
<br />
Over the past week, I have been making a few small refinements, consisting of fixes:<br />
<br />
* Preventing a segfault when creating a dimension<br />
* Fix for incorrectly placed dimension - was difficult to locate the bug<br />
* Fixed a rounding error which meant decimals were not being displayed<br />
<h4 style="text-align: left;">
Dimensions Arrows:</h4>
I have also added a support class for displaying dimension arrows, although these are just diagonals at the minute.<br />
<br />
'<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTDMfv28rLJqSdo4BqlLUAuP28kjNOu8BSMs3qTbjRqI6h6icftNGQhZZ5cMHelyl2UwOz4K0cHgxL8bxCjjnpKN4A7GOIGUK4WKB1WN9ZP2bSQT0GboDx3-ScGMvm9KPQ0CO262rEvo0/s1600/dims.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="301" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTDMfv28rLJqSdo4BqlLUAuP28kjNOu8BSMs3qTbjRqI6h6icftNGQhZZ5cMHelyl2UwOz4K0cHgxL8bxCjjnpKN4A7GOIGUK4WKB1WN9ZP2bSQT0GboDx3-ScGMvm9KPQ0CO262rEvo0/s400/dims.png" width="400" /></a></div>
<br />
Having a separate QGraphicsItem class is more useful as it keeps the source code tidy by having the drawing code separate. Also it gives flexibility to manipulate the arrows, such as scaling, flipping etc more universally.<br />
<br />
It would also be nice to get the page template working again, but waiting on some work to be ready!<br />
<h4 style="text-align: left;">
Projected Dimensions:</h4>
<div>
I spent of time to work on this. Originally I thought this was going to be a difficult task. I thought that to get projected dimensions, I would have to make measurements of projected geometry, which would have been laborious to do. Instead, a quite simple solution is to use the same measurement code for true lengths, but project the measurement vector (direction and length) onto the view plane. Taking our complex case below, there will be a difference between true and projected dimensions.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFT9DUsAWT3M7zyv-uL8OdUNB3eesEVg-4KFXsOPBsyNdp2YP4aqDxSfzSRAYhcs_TYhhX5cFDXETGZMHtE8iNX-37EXW4RWKr7OCv-kqkSp7wv5Y77zpWwuoxBWmVLy4Uq-XE6aXOUCw/s1600/projectDims1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFT9DUsAWT3M7zyv-uL8OdUNB3eesEVg-4KFXsOPBsyNdp2YP4aqDxSfzSRAYhcs_TYhhX5cFDXETGZMHtE8iNX-37EXW4RWKr7OCv-kqkSp7wv5Y77zpWwuoxBWmVLy4Uq-XE6aXOUCw/s1600/projectDims1.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Taking the top projection of this object and taking dimensions for the corner of each pad the result is below.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_6uL8ISgCOoqNwPYZCKEajVWwNLqvpCgsVCG4pUXlwWB4V5Qr_pIPTvb9Ts7up2oPmUr5wj5XPz_5YL-hkX3AaMbwmFYpHs3U3z7F242O6yw5_OB-77kzWIYvs2TvdCE-PaWc3cJwhWQ/s1600/projectDims.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_6uL8ISgCOoqNwPYZCKEajVWwNLqvpCgsVCG4pUXlwWB4V5Qr_pIPTvb9Ts7up2oPmUr5wj5XPz_5YL-hkX3AaMbwmFYpHs3U3z7F242O6yw5_OB-77kzWIYvs2TvdCE-PaWc3cJwhWQ/s1600/projectDims.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
The dimension on the far left is the true length, and the right is the projected length. I have attempted to make all dimensions which reference orthographic views to use projected type. </div>
<div>
<br /></div>
<div>
The next step is to work on getting edge to edge dimensions and angles working. The angles bit is more complicated because the angle value measured is based on the quadrant chosen. </div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-37734773489385655682013-05-22T14:29:00.002-07:002013-05-23T12:56:26.412-07:00Quick experiment again with Sectional Views & General Updates<div dir="ltr" style="text-align: left;" trbidi="on">
I am midway during exam season (two weeks) long and things seems to be going swimmingly which I'm happy to report.<br />
<br />
Over the past two weeks I've just spent some time tidying up the code and trying to fix a pretty nasty crash in QGraphicsview, anytime you updated the view. I really hope this has gone, but if during testing you suddenly experience a crash when the view updates, please inform me. It seems to have disappeared but esentially was a problem with incorrect bounding boxes as the usual case is. Additionally I've just tidyied up the code and improved the performance by having QGraphicsView using a backend cache, so it doesn't have to constantly redraw features when it is unecessary.<br />
<br />
Today, I decided to have a day off revision, as to be honest I am fed up with the mundane repetitiveness. Apart from what I mentioned earlier I wanted to take a quick diversion from the orthographic project stuff I've recently been looking at which I've also made a few improvements on.<br />
<br />
I wanted to take a look back at sectional views which I had to give up on because I couldn't correctly produce faces by processing each edges in the correct order. I mentioned this in a <a href="http://freecadamusements.blogspot.com/2013/02/drawing-module-section-views.html">previous blog entry</a> some time ago.<br />
<br />
Eventually I managed to find the problem and unexpectedly half of the result was from the drawing code itself, where although the edges were in the correct order there was a chance these could be reversed. Eventually I got something working on most faces. <br />
<br />
I then updated the work on the sectional view and behold...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYoj4bHxCvXW-lbzV8v9uzxrvU5ZoPhH-2HdCt8-YZu-H0mFyRowuswF75L-NxNZq4a-XILo6WzrbzD2cwXVBO7aTlcdUe9CUd7Wu7eW78Wq5yuis8LWDy-TFdkHXuLR3VR9VZzD0yju0/s1600/sect1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYoj4bHxCvXW-lbzV8v9uzxrvU5ZoPhH-2HdCt8-YZu-H0mFyRowuswF75L-NxNZq4a-XILo6WzrbzD2cwXVBO7aTlcdUe9CUd7Wu7eW78Wq5yuis8LWDy-TFdkHXuLR3VR9VZzD0yju0/s640/sect1.png" width="640" /></a></div>
<br />
This was taken from a simple planar cut through straight through the centre:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEL1c0-xzQzabkaitTCOWenbTBvg8z_qDRYefhq2ZyauLVaoPMtqc8JZpvwfmJE65Z7Lc43VXuDDMmVjfx9sPiSF2Em-rllm6vKilOgLM2Lj8wPhv2J6n4aQJxhPKqHebNV3Mjf_q_prY/s1600/sect2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="432" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEL1c0-xzQzabkaitTCOWenbTBvg8z_qDRYefhq2ZyauLVaoPMtqc8JZpvwfmJE65Z7Lc43VXuDDMmVjfx9sPiSF2Em-rllm6vKilOgLM2Lj8wPhv2J6n4aQJxhPKqHebNV3Mjf_q_prY/s640/sect2.png" width="640" /></a></div>
<br />
To be honest it's only a proof of concept that i've created over the past few hours. I have identified that some changes are needed to improve the structure to something less 'hacky'. The other limitation is there won't be use of 'true' dimensions because references are lost when the boolean cut is applied.<br />
<br />
----------- UPDATE ---------<br />
<br />
We all like updates. Spent this evening on it again, rather naughtily and tidied up the areas that I weren't happy with. The section plane is now it's own object in the drawing view, so I had to build up some infrastructure around there which I am more happy with. Now we can finally get some sectioning goodness!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV5G5JMoBVhwai-fgMCTh4T7U64iEq80-gaKSlq-cIeEfiIgx3GQ3pmNOlod-7WzEiylQT6ybJ4qk7Kwns_Vfrrvn8kSx-3XCHx8_E3vx-OJkzR2jkxdZTtVlyXDZTT-N1DDJAP8q6VKU/s1600/sect3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhV5G5JMoBVhwai-fgMCTh4T7U64iEq80-gaKSlq-cIeEfiIgx3GQ3pmNOlod-7WzEiylQT6ybJ4qk7Kwns_Vfrrvn8kSx-3XCHx8_E3vx-OJkzR2jkxdZTtVlyXDZTT-N1DDJAP8q6VKU/s1600/sect3.png" /></a></div>
<br />
<br />
I need to fix a bug that's causing a segfault, so hopefully soon I can push this for people to try and experiment with probably more complicated shapes. </div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-81925443099139062232013-05-10T15:37:00.001-07:002013-05-10T15:37:34.604-07:00First work on Orthographic Projections<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: left;">
Having had a bit of a day off, I spent some time working on Orthographic projections with the Drawing Module. One of the problems with the older implementation was that only a projection direction was provided. This meant that the GUI / SVG had to deal with applying transformations to obtain the correct projection which isn't really ideal. All this took a while to realise, however, both the projection direction and its orientation (X-Axis) can be set during the Open Cascade Projection Algorithm.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiGbJR6XvihQk3LqMHFVaEpCMe_ctqx39j-bUyBhJUXdbb1xtQi7bCfEFDLUFDjuueXiAgUkJEl1bGzMnZA1mP3Hnyqyv8kKIKvcZQ1bKLdgGABCI8YMV6cfNpqPaFtbhwyCEFKWHyGUU/s1600/t1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiGbJR6XvihQk3LqMHFVaEpCMe_ctqx39j-bUyBhJUXdbb1xtQi7bCfEFDLUFDjuueXiAgUkJEl1bGzMnZA1mP3Hnyqyv8kKIKvcZQ1bKLdgGABCI8YMV6cfNpqPaFtbhwyCEFKWHyGUU/s640/t1.png" width="640" /></a></div>
<br />
The result is above and it later will allow more convenient production of orthographic projections, by setting the view type below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfo6FxHNLmc7PCx3igPIdQbOfZaaKOlRoxOBf7zBjpMZ9MRCTjP42on-ze6dT8h0C3xU0mslwAhpv5X4K4XDpnTJ3tkosQ5U1mNgoGJPeUKvwLrAsaoc-TN_N8GypKB3SSP8pjIRmaWc/s1600/t2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfo6FxHNLmc7PCx3igPIdQbOfZaaKOlRoxOBf7zBjpMZ9MRCTjP42on-ze6dT8h0C3xU0mslwAhpv5X4K4XDpnTJ3tkosQ5U1mNgoGJPeUKvwLrAsaoc-TN_N8GypKB3SSP8pjIRmaWc/s1600/t2.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The next step is to collect these orthographic projections together and allowing having these align to each other. </div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-23495586972872140202013-04-26T02:15:00.002-07:002013-04-29T05:38:56.691-07:00Drawing Updates & Bloodhound SSC<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<br /></div>
Pardon me for starting the post off-topic, but last night I went to a talk given by Richard Noble the director of Bloodhound SSC (below), aiming to achieve Mach 1.4 or 1000 mph (~1600km/h ). I freely admit it was an inspiring talk and especially given how little I knew from the small excerpts produced by IMechE - UK's institute for Mechanical Engineering, it provided to be very informative.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img height="190" src="http://www.bloodhoundssc.com/sites/default/files/BloodhoundSSC_frontpage_Nov12_0.png" style="margin-left: auto; margin-right: auto;" width="640" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Bloodhound SSC</td></tr>
</tbody></table>
Why I raise this, is that one of the key emphases on the talk is about inspiring the next generation of Engineers not just in the UK but all over the world - akin to Nasa's Moon Landing Programme in the 60's. We share a responsibility as engineers to foster the development of the youth. Many open design such Raspberry Pi and Adruino are sharing such successes involving children and young adults alike.<br />
<div>
<br /></div>
<div>
Without becoming too philosophical, FreeCAD would be part of this idealistic goal. Being able to provide free but importantly open tools that I never had when I was at school would bring opportunities I wouldn't have dreamt off - I was the one of the last generation at our school to produce hand-drawn drawings, which shockingly was only six years ago.</div>
<div>
<br /></div>
<div>
Ultimately if you cannot contribute to FreeCAD as a programmer, there are endless ways you could help and I wish to thank the members of our community for doing so without initiative!</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Back on topic: Drawing Tweaks and Updates</h3>
<div>
Probably the biggest changes came last night and was most surprisingly because of the fact how tired I was. The Drawing View (QGraphicsView) updates itself when you change it's property, this includes dimensions too and surprisingly works very well. Additionally the drawings are correctly created when you restore a document. </div>
<div>
<br /></div>
<div>
Hopefully I'll publish a video to better demonstrate this, because find it a satisfying result.</div>
<div>
<br /></div>
<div>
The other changes is scale independent rendering, edges retain the same stroke width regardless of the document zoom.All this we get for (nearly) free in QGraphicsView! <strike>There's a problem with selection at the minute, but hopefully will be sorted out soon </strike>(Fixed). I don't believe this is easily done using SVG because transformations are applied at object level. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRf9hkdHKPkX3lzRRDgCFnFwk3vdLho3-z6NOkj7Pl93kZ622lqOzEzTcwjjdX4pk6JH0cm_2dWK-gDZTSFHa1388VsVvm0iukah2SyFakL3o1Ac27pt5F368h0uBDfmvQiqtvQ7p-Drs/s1600/pi8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRf9hkdHKPkX3lzRRDgCFnFwk3vdLho3-z6NOkj7Pl93kZ622lqOzEzTcwjjdX4pk6JH0cm_2dWK-gDZTSFHa1388VsVvm0iukah2SyFakL3o1Ac27pt5F368h0uBDfmvQiqtvQ7p-Drs/s1600/pi8.png" /></a></div>
<div>
<br /></div>
<div>
The example of above scales as you would expect, which was scaled really small on my screen but is not desirable in CAD drawings. You don't want lines to obscure each other when you zoom in, especially on an extremely complicated part with greater detail such as below. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiApZI04AJoQmekDmypDPmAvr_y10w6m1j0h3UET6oBAB6cVu8oEctf87mG9gswUZSOBS1JyHNgQFtSUbtCTapTSXCehE_CIqPanOKwTOfIKP7Szuz3qKM8no75EaOORcuCFfP6um2DSgQ/s1600/pi9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiApZI04AJoQmekDmypDPmAvr_y10w6m1j0h3UET6oBAB6cVu8oEctf87mG9gswUZSOBS1JyHNgQFtSUbtCTapTSXCehE_CIqPanOKwTOfIKP7Szuz3qKM8no75EaOORcuCFfP6um2DSgQ/s640/pi9.png" width="640" /></a></div>
<br />
<br /></div>
<div>
I've also added a scale option. This currently transforms the original FreeCAD Part, however, I am still unsure is the best approach in terms of performance which could be natively applied in the projection algorithm. However, now it appears to work correctly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih3dDoV7YiGCKn8UurVG0BbPO4IPF9jXYvOp4wgfe1X49Iq4wdn1N-yisLsNTOJKUKgcGPAlbEm2QGR4x-8zvPwRC9KAI6V0pjZ04jlSyJWlJ6IamqxBZ3M_3p2A-337wHieKI70hLLQ8/s1600/pi10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih3dDoV7YiGCKn8UurVG0BbPO4IPF9jXYvOp4wgfe1X49Iq4wdn1N-yisLsNTOJKUKgcGPAlbEm2QGR4x-8zvPwRC9KAI6V0pjZ04jlSyJWlJ6IamqxBZ3M_3p2A-337wHieKI70hLLQ8/s640/pi10.png" width="640" /></a></div>
<br /></div>
<div>
In the previous drawing module the scale was applied at the presentation layer in SVG and wasn't really the best solution although it worked.</div>
<div>
<br /></div>
<div>
<strike>I wanted to put a picture up but I am currently upgrading Kubuntu. It will most likely not go smoothly, but atleast I'll be ready to report any problems compiling with FreeCAD.</strike></div>
<div>
<br /></div>
<div>
Taken a short screen cast to show off the Drawing Module in it's current state. Only had 15 minutes to make it this morning, so sorry for the lack of quality!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/J-FdrZnLq2Q?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Note: The drawing artefacts appear when recording the video for some reason but otherwise are not there normally.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-7189932564435834552013-04-20T04:00:00.003-07:002013-04-20T04:00:49.913-07:00Finally we have arcs that work!<div dir="ltr" style="text-align: left;" trbidi="on">
For over a month this has been a problem where on 3D projections, arcs are turned into partial ellipses but were being incorrectly drawn. Attempts to diagnose the problem were unproductive - see the forum <a href="http://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=3937">topic</a><br />
<br />
There a sudden moments that make you realise that perhaps there is an easier way, just like last night. I though of mimicking the previous code that generates SVG directly. Instead of creating an actual ellipse arc, an cubic arc is produced instead - see the <a href="https://developer.mozilla.org/en-US/docs/SVG/Tutorial/Paths">Mozilla Docs</a>.For Qt to render SVG it must process this, so that there must be a method for drawing these somewhere. After some searching I found a function available in <a href="http://qt.gitorious.org/qt/qtsvg/blobs/raw/5391ecd599858a416999e3e7bb367653edf89383/src/svg/qsvghandler.cpp">qsvg/qsvghandler.cpp</a>. This had what I desperately needed and thanks to Opensource is possible.<br />
<br />
Literally copy and pasting the relevant code - later will be re factored to be simplified if possible, this morning I got it working and produced the results I was craving!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjauWPt1kgpREZ4j23h1Xkx-MdCcNNLqLEGk58vMp3VAwdBw2fr1QYppAPUkXrnrv0qF6z9e_JvjmYmblPNP7y7JOgIctDwv_fkSBPWhimbSDvFsvYX73FfhKvtCoMXZs8HwHS1aVZskoQ/s1600/pi7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjauWPt1kgpREZ4j23h1Xkx-MdCcNNLqLEGk58vMp3VAwdBw2fr1QYppAPUkXrnrv0qF6z9e_JvjmYmblPNP7y7JOgIctDwv_fkSBPWhimbSDvFsvYX73FfhKvtCoMXZs8HwHS1aVZskoQ/s1600/pi7.png" /></a></div>
<br />
This accomplishment crowns the ending of my Easter Vacation. I return to University tomorrow.<br />
<br />
The couple of bigs tasks remaining are growing smaller. Ideally, I need the drawing to update automatically by itself, but changes don't propagate into non-3d views. Also we need working templates - looked at by Joshua.<br />
<br />
The other is re-doing the export code - we get .svg and .pdf free with QGraphicsView, but .dxf.One thing I am going to enquire is an export to librecad. dxf sounds like the devil, so I think promoting an open format would go well.<br />
<br />
The remainder should be smaller jobs that other people could get involved with. By then I hope I could get this be ready for testing by mid-summer. </div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-3568291563212135099.post-90661558132619367642013-04-18T04:09:00.000-07:002013-04-18T11:08:59.699-07:00Little updates<div dir="ltr" style="text-align: left;" trbidi="on">
Spent the past few days tidying up the Drawing Module as a needed break from revision.<br />
<br />
<br />
It is starting to come together:<br />
<br />
<ul style="text-align: left;">
<li>Added support for radius dimensions on arcs.</li>
<li>Added support for point to point dimension</li>
<li>Improved selection of edges and vertexes</li>
<li>Antialiased Edges</li>
</ul>
<div>
For an hour I spent adding a nicer selection box for moving a views around which definitely helps prevent annoying selection of the view. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYNjuUS6-FNKq-wLwiX9JJGItESziQZnJtYVVHsADj2J_Hk9Nf_jLViHPAzsrciahv5iL9U_Cyrc2i3dRpnIxMPh1Yq2_-22JuYjqiaiHxEdCuAQDcxVl_fZ-9Vcl8g6XUH-uauVX6R7U/s1600/pi3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="532" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYNjuUS6-FNKq-wLwiX9JJGItESziQZnJtYVVHsADj2J_Hk9Nf_jLViHPAzsrciahv5iL9U_Cyrc2i3dRpnIxMPh1Yq2_-22JuYjqiaiHxEdCuAQDcxVl_fZ-9Vcl8g6XUH-uauVX6R7U/s640/pi3.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Dimensions are coming together too quite nicely, although the radius dimensions don't work yet in 3D view. I probably add some arrows, but these are not high priority. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlcoLCuR0aO3UWEdduiOCY4KglaLg__wkDLaP59QwdMAMwt6rMroA_fPbYEMQIi_ZTUEo8sL4qInPLTVQnjwKl1m1VFY4b2FMb-AsP0N0RNle8C-vhgbbnA2sYWLcsfj5NFva6DGFOxc/s1600/pi4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlcoLCuR0aO3UWEdduiOCY4KglaLg__wkDLaP59QwdMAMwt6rMroA_fPbYEMQIi_ZTUEo8sL4qInPLTVQnjwKl1m1VFY4b2FMb-AsP0N0RNle8C-vhgbbnA2sYWLcsfj5NFva6DGFOxc/s640/pi4.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div>
I've started the work on correctly showing hidden lines. I am pretty pleased with the result. I have opted for selecting the whole edge (visible and hidden), hopefully that seems reasonable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO4SYlr9JKloZJMreG9YEkuydrZfVDkAnZFX34KWak4pezPRQqbDW78fBjlu4Zhv2ThG1f1wWW3cJqLw9FdI3XNdRvMbWJg6kprKjm6CsZLNWCTMnhyzr0hc07EaEdS4zpzbjE6IOqoWk/s1600/pi5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="406" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO4SYlr9JKloZJMreG9YEkuydrZfVDkAnZFX34KWak4pezPRQqbDW78fBjlu4Zhv2ThG1f1wWW3cJqLw9FdI3XNdRvMbWJg6kprKjm6CsZLNWCTMnhyzr0hc07EaEdS4zpzbjE6IOqoWk/s640/pi5.png" width="640" /></a></div>
<br /></div>
<br />
I was slightly disappointed to find that references for some edges cannot be find in 3D views, however is a limitation imposed by Open Cascade. If a reference cannot be found, these edges are not selectable, since they cannot be used for any measurements. One possible idea to circumvent this problem is to compare the projected edges with references to edges on the original geometry that weren't found. This isn't really ideal, but would be a temporary solution.<br />
<br />
One of the other problems is ellipse arcs which still I cannot figure out.</div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3568291563212135099.post-33045656294939726962013-04-12T13:30:00.001-07:002013-04-12T13:30:12.763-07:00Parametric dimensions in the Drawing Module<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm2JlNaSDkZKAI9uvjyBmdO5IEGO0Qm6-xIIWtA5C4T6uml6Qixw8ViSvA5xXxndysF5QFQ1JsKdHLhF-7J49h5MPVcvRklHFqZWSjHQi4CkWH34aIQx54txz9fOarkXfmZyhV3RGa70Q/s1600/dims2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm2JlNaSDkZKAI9uvjyBmdO5IEGO0Qm6-xIIWtA5C4T6uml6Qixw8ViSvA5xXxndysF5QFQ1JsKdHLhF-7J49h5MPVcvRklHFqZWSjHQi4CkWH34aIQx54txz9fOarkXfmZyhV3RGa70Q/s640/dims2.png" width="640" /></a></div>
<br />
After about three weeks, of having to work on various assignments (nearing completion) and revision, I finally had a day off to work on dimension support in the Drawing Module (see above and compare to previous post).<br />
<br />
Obviously the dimensions look much better and are correctly positioned and it also shares similar behaviour to sketcher where if the datum label lies outside the arrow lines change position accordingly.<br />
<br />
Additionally the dimension can be set to the edge length in X or Y direction now quite easily by changing the dimension mode. Currently the dimensions only work for Straight Line edges, but I plan to address some support for vertexes and obviously circular arcs.<br />
<br />
One of the interesting things that had to be thought was how to reference edges that are broken up into smaller segments by any geometry in front.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVQB_y_bgF8O5s_TXo0kh_OuphgUyLGNvH_tPrzEOoxF1pjuoUkm6dIp2tdpqErAo5uLEFsaPAQqJkB9ll71SRqE4cuOkRwzM7SaYucFlT9ZKFyewFLvLWHuM314jevLgO5WVyZJ8YMcI/s1600/dims1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVQB_y_bgF8O5s_TXo0kh_OuphgUyLGNvH_tPrzEOoxF1pjuoUkm6dIp2tdpqErAo5uLEFsaPAQqJkB9ll71SRqE4cuOkRwzM7SaYucFlT9ZKFyewFLvLWHuM314jevLgO5WVyZJ8YMcI/s1600/dims1.png" /></a></div>
<br />
My first attempt at this failed miserably, where I thought I would reference each segment of the edge and find the ends from there but clearly it wouldn't work. After scratching my head, I thought the best way to go was getting the reference to the original geometry and projecting the whole edge and using this instead for dimensions.<br />
<br />
The limitation with this strategy is that if the original reference isn't available you won't be able to get true parametric dimensions. Generally this isn't a problem - nearly all the time I have found references are available and if they aren't usually it is for curves projected onto a 3D view.<br />
<br />
It was a bit of work to get to work, because I was using HLRBrep_Curve and that require figuring out what type of curve was produced when finished. I kept to this OpenCascade Algorithm to allow perspective projections if they were ever needed. Luckily it worked!<br />
<br />
<h4 style="text-align: left;">
<b>Behold Parametric Dimensions!</b></h4>
The big test really was to change the projection direction and see what happens...<br />
<b><br /></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiO4g2pkXX4GjYWSt74AXTWb2pHvIekNBrrZ_vACZiqEgSJYA5i6mfVEyXMTe_4CDVe-I1iLHt8NeEOtHSfuA-iUhsjR6TR1sqNswREnWcF27-7gtCsHbS33Lxhm9b4a8AGpCds_D3AYQ/s1600/dims3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiO4g2pkXX4GjYWSt74AXTWb2pHvIekNBrrZ_vACZiqEgSJYA5i6mfVEyXMTe_4CDVe-I1iLHt8NeEOtHSfuA-iUhsjR6TR1sqNswREnWcF27-7gtCsHbS33Lxhm9b4a8AGpCds_D3AYQ/s640/dims3.png" width="514" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And yes it worked - although the datum label positions need correcting, nothing else had to be changed. Now changing the geometry (nothing too drastic)...</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDpNOZyxqSJ3hhVinZLVoKar94eDoGa9GsfW3zuYmL4u0EJjVXm4mQr2i42XWvslGiTqD14PyUjAX4VShGQ9t51tAdl2buNL-KflulVI5RZSJaXO8t8SX0e0q_OZteSs3gfJhpe7cDLYk/s1600/dims4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="314" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDpNOZyxqSJ3hhVinZLVoKar94eDoGa9GsfW3zuYmL4u0EJjVXm4mQr2i42XWvslGiTqD14PyUjAX4VShGQ9t51tAdl2buNL-KflulVI5RZSJaXO8t8SX0e0q_OZteSs3gfJhpe7cDLYk/s640/dims4.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It's a pleasing result because it's been several months in the works to get this working, not knowing if this would be even possible. Obviously there's a lot left to do.One of my biggest problems at the minute is that if there are changes in the Document Structure, the drawing view must be closed and re-opened</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The next priority is to tidy the module up more as it's still feels experimental.</div>
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-3568291563212135099.post-2112877185794989462013-03-17T18:04:00.001-07:002013-03-17T18:04:04.120-07:00First step of having DImensions in Drawing Module<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSaDShL_bGP9xejIxB35mEPhRWenNrSKXQxpRwxI8BhtDfwgHfqlas_TP_FVaiutjdClmhxfNRpDwCosoZDlRg-p2EL5h5G7R5E6J6LNx6LGg3t28ldmdg-B77br-znHyInO0dnGc3ZY/s1600/dims.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSaDShL_bGP9xejIxB35mEPhRWenNrSKXQxpRwxI8BhtDfwgHfqlas_TP_FVaiutjdClmhxfNRpDwCosoZDlRg-p2EL5h5G7R5E6J6LNx6LGg3t28ldmdg-B77br-znHyInO0dnGc3ZY/s1600/dims.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Spent today working on adding dimension support. The first results are in and are quite pleasing. The dimension lines aren't correct but do indeed move interactively and the values for the dimensions update with changes basic changes in geometry. Obviously this is no where near being done, but is a step in the right direction once again.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
-----</div>
<div class="separator" style="clear: both; text-align: left;">
One area that does become problematic is making large changes in the geometry, and will be quite troublesome to deal with, even with robust naming. This should be a problem with vertices. because they cannot be decomposed further. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Currently dimensions refer to the individual projected edge, or vertex because in theory multiple projected curves could exist. This needs further thought, but perhaps the best solution is consider merging projected edges together which share the original reference to the object and then having dimensions refer to these instead. Any ideas? </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-3568291563212135099.post-58580546668986669112013-03-15T10:40:00.000-07:002013-03-15T10:40:27.327-07:00Projecting Points - Drawing Module<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW016qloiwA2SoJzNQ5prP19jf5XzC1yoMA5Kj6ASEppEp_QwEb2XEfeR8u5KGdLz5vrukfjvDjbkIHa9qgavcgQbM9SyofWGgUtO200dYcTxTBWZ-cxvEaLbM7oNZe0RzsvXGonm0oNQ/s1600/pntProjection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW016qloiwA2SoJzNQ5prP19jf5XzC1yoMA5Kj6ASEppEp_QwEb2XEfeR8u5KGdLz5vrukfjvDjbkIHa9qgavcgQbM9SyofWGgUtO200dYcTxTBWZ-cxvEaLbM7oNZe0RzsvXGonm0oNQ/s1600/pntProjection.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Having started on dimensioning support I stumbled across quite an obvious problem, how would I do point to point Dimensioning. Obviously I could extrapolate the points from the edges and use these, but any changes in the Base FreeCAD model and your dimensions would very easily mess-up. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I started thinking about this last night and indeed to support such dimensioning modes with parametric relations, the points would have to be projected from the base FreeCAD model. I hit a brick wall trying to figure this out last night, but suddenly it came to me this morning. Sleep is a powerful thing. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
All I had to do is use the Projector algorithm to project points from project curves and then check if these can be referenced to the original object by checking if the topology exactly matches. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The result is the above, all the points are recognised from the original object and now means we can in theory reference these. It is slightly dumb at the minute, because it projects points from all the edges (even if they are hidden). However, it should be trivial to fix this. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Obviously in the GUI, the points will be hidden until an appropriate tool is used but is a step in the right direction indeed!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<i>Easter break officially begins today and hopefully will have a helper who can assist me on the Drawing Module too *fingers crossed. </i></div>
<br /></div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-3568291563212135099.post-20460658185497331142013-03-14T06:19:00.005-07:002013-03-14T06:19:58.816-07:00Further work on Measurements Framework<div dir="ltr" style="text-align: left;" trbidi="on">
I've spent a bit more time and adding more measurement tools that should be quite useful now for querying geometric properties of FreeCAD objects. This now includes measuring the<br />
<ul style="text-align: left;">
<li>total length of selected edges</li>
<li>shortest distance between point and edge</li>
<li>shortest distance between point and face</li>
<li>radius of an arc or circle</li>
</ul>
<br />
Also now we can calculate the centre of mass for a selection of objects in a straightforward manner:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvy0txzskh_KRT-rqHgXAyqR_PAXAN_HuVi0I4lqPh1NqJAuCukubeE1ZCQEJTDJMm-q0QzkFJDsTYtVlCqihyphenhyphenT3qJ-8B2hzeHHZihwn0CKKfUlRhfzQjkfuHFQpHHTnVvy5h4gQL2NlY/s1600/centerOfMass.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvy0txzskh_KRT-rqHgXAyqR_PAXAN_HuVi0I4lqPh1NqJAuCukubeE1ZCQEJTDJMm-q0QzkFJDsTYtVlCqihyphenhyphenT3qJ-8B2hzeHHZihwn0CKKfUlRhfzQjkfuHFQpHHTnVvy5h4gQL2NlY/s640/centerOfMass.png" width="606" /></a></div>
<br />
<br />
Fundamentally these were quite easy to calculate as they are provided by Open Cascade essentially for free and therefore it hasn't been very difficult to implement this.<br />
<br />
<br />
Since the essential functionality is already there, the next step is to integrate this with the Drawing Module. This should hopefully be the start a dimensioning tool!<div>
<br /></div>
<div>
Hopefully I can push this onto Git for people to try during the weekend.<br /><br />
<br />
In slightly unrelated news to FreeCAD: I have finally received some funding for an interesting expedition that I will be attempting once finished University in June. Under this premise I do hope to continue working on FreeCAD as I will still be in civilisation and should have enough time to make smaller contributions and experiments that may be useful. It would be interesting to see if it would be possible to develop this on the go. Anyway we will have to see!<br />
<br />
<br />
<br />
<br /></div>
</div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3568291563212135099.post-25438282239915405722013-03-09T02:18:00.002-08:002013-03-09T02:18:37.223-08:00First signs of measuring<div dir="ltr" style="text-align: left;" trbidi="on">
I spent last night putting something rudimentary together for this Measurement module to see how it will work. Surprisingly, I was up till 1:30AM probably because of a sugar high brought on by making chocolate cake last night. Nevertheless I was up bright and early to finish off my work from last night, and already we are bearing results:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiF1KLjezU8_WttXMr-r3rg5ZZULQa2bn05oc2o1qL3HVtVgOUqBjvH1QPSY1BbCY7x4VOeyS2vYu9sjG0jMM09URb-RK4TYlRdUJvsb4uOJT9Q4bhc6sGcB9fwPBq3ebvP3tB5Sc2Pq4/s1600/measure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiF1KLjezU8_WttXMr-r3rg5ZZULQa2bn05oc2o1qL3HVtVgOUqBjvH1QPSY1BbCY7x4VOeyS2vYu9sjG0jMM09URb-RK4TYlRdUJvsb4uOJT9Q4bhc6sGcB9fwPBq3ebvP3tB5Sc2Pq4/s1600/measure.png" /></a></div>
<br />
<br />
Below 'Import Measure' are the commands used for making a measurement, hopefully it seems quite logical:<br />
<br />
The output works correctly and fortunately when the geometry in the FreeCAD object does change, taking a new measurement does indeed return the correct result.<br />
<br />
My only concern at the minute is whether it seems a good idea to bundle so many different measurements together in one package, even if the correct mode can be chosen and when the selection is incorrect an error is politely thrown to the user.<br />
<br />
I guess in reality, this is more of a convenience solution to provide parametric measurement for most important measurements that both the user and in the case of Drawing Module may need.<br />
<br />
What are people's thoughts?</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-90664397846478371752013-03-07T14:11:00.000-08:002013-03-07T14:11:00.422-08:00Measurements Framework: (Plan of Action)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
Having some further thought on making the measurement framework, my overall idea is that this should be very accessible to a novice user either using the command line or the GUI. Simplicity is key. Specifically the user should be able to specify a set of geometric features: edge or points and the measurement framework figures the rest out - that's the plan atleast!</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsJoHN1XEfjYRcYRqsn7nhk4xtJawueMvKkTBqw9aRK9BvXiNZry69YmVjJH0uZr0XN-JGzbfvQ_PpiEWOBijJyxw5jOK_jwcJx5AX00g-JHMotyWJhX5yZgKSU0INufPVSVwymyzf1cM/s1600/text3873.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsJoHN1XEfjYRcYRqsn7nhk4xtJawueMvKkTBqw9aRK9BvXiNZry69YmVjJH0uZr0XN-JGzbfvQ_PpiEWOBijJyxw5jOK_jwcJx5AX00g-JHMotyWJhX5yZgKSU0INufPVSVwymyzf1cM/s640/text3873.png" width="418" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This could be extended to gather more complex information such as surface area when specifying a face for the measurement or perhaps retrieving the moment of inertia or mass, for a given FreeCAD part. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3 style="text-align: left;">
Querying Information:</h3>
<div class="separator" style="clear: both; text-align: left;">
This builds up a quite complex cases, but what I think would be eventually be a good idea is to create an extensible approach, so that plugins could be called to provide extra methods when querying a set of features. This is over-kill at the minute, but could be interesting. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If a particular query cannot be made - e.g. querying the surface area of an edge an Exception will be thrown. Potentially this means we could introduce annotations that can reference the measurements and appropriately display output: e.g. 'Volume of My FreeCAD object: myMeasurement.volume()'</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h3>
Building Annotations and Dimensions</h3>
<div>
Making use of measurements can be temporary, (whether in the command line or GUI). Using an object to store this information with reference properties means that these can be parametric hence update automatically. This means we should be able to pass this Measurement Object to a Dimension Feature and it can automatically create this and be absorbed into the Document. </div>
<div>
<br /></div>
<div>
The Dimension Feature will be an Annotation Feature which will provide a more extensive coverage of options such as tolerances, dimension line type etc. These Dimension Features could in theory be used in the Drawing Module or in any other area of FreeCAD or atleast I would hope. </div>
<div>
<br /></div>
<div>
<i>Hopefully this sounds good!</i></div>
<div>
<br /></div>
<div>
<b>Now it's time to shut up and time to start coding!</b></div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3568291563212135099.post-84685645857292661292013-03-05T16:48:00.002-08:002013-03-05T16:48:22.092-08:00Thoughts on making Measurements<div dir="ltr" style="text-align: left;" trbidi="on">
After having some troubles with projected faces (dealing with correct wire orders) for the mean time I have considered looking at measurements or the ability to add parametric dimensions to drawings. These are dimensions which will update with geometry accordingly.<br />
<br />
With some discussion on the <a href="https://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=3549&p=27749&hilit=measurement#p27749">forums</a> about this: further discussion encouraged the idea for a generic measurement framework which would be useful throughout FreeCAD to make useful parametric dimensions and 'temporary' measurements which are common place inside most CAD packages.<br />
<br />
Temporary measurement is a tool that provides a quick and convenient method to check the length of an edge or the distance (including components) between two points. These points use geometric references to provide a more accurate measurement unlike previously.<br />
<br />
Parametric dimensions are more permanent and would be stored inside the Document as a feature or an annotation in the Drawing Module.<br />
<br />
The Measurement framework aims to take a set of geometric entries such as line edge or two points and calculate the distance between them using a given vector. This is fairly simple stuff, but having a centralised framework would allow it to be adopted in other areas in FreeCAD, namely the Drawing Module for providing dimensioning support. it is in fact possible to calculate this from the projected shapes inside Drawing but using the previous reference geometry provides a means of obtaining the 'true' value for the geometric feature and will adapt to changes to the 3D Part more sensibly. However, in the future there could be an option for using projected lengths. <br />
<br />
Eventually, I would imagine this can be extended for displaying and calculating more complex properties such as moment or inertia, centre of mass etc. For the time being the measurement framework will only provide a c++ and python framework. The focus for the interface is simplicity - where it will specify the geometric features used and should then be able to determine measurement. There will be most likely ambiguous cases so giving an option to override this seems sensible.<br />
<br />
In the Drawing Module my aim is to apply a similar philosophy of creating dimensions using one tool; some people don't prefer this understandably, so there will tool bar and menu options for creating specific dimension types. In most cases this will allow convenient dimensioning.<br />
<br />
I still need to figure out including point contacts since these are not explicitly projected by OCC and are contained inside the edge data.<br />
<br />
<i>This was slight regurgitation of thoughts I had on this before I attempt to start so apologies if this wasn't written well.</i><br />
<h3 style="text-align: left;">
+ Checking out the current state of the Drawing Module:</h3>
I figured that it would be good idea to share my progress so far and allow people to contribute. The module is no where near ready for any testing - so please don't point out the obvious if something's broke. If there are any users interested in helping develop I would be more happy to take feedback and contributions to help with development!<br />
<br />
Please checkout the github repo:<br />
<a href="https://github.com/mrlukeparry/FreeCAD_sf_master/tree/drawing">https://github.com/mrlukeparry/FreeCAD_sf_master/tree/drawing</a><br />
<br />
<br /></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3568291563212135099.post-47084352680628335462013-02-28T07:52:00.000-08:002013-03-02T01:47:04.369-08:00A bit of fun on the side: Compiling with Clang<div dir="ltr" style="text-align: left;" trbidi="on">
In the other bit of spare time I have considered looking at compiling FreeCAD using Clang. The end result is that only a few changes are needed to be made to the FreeCAD source so that it compiles with Clang.It doesn't seem to affect building using g++ either. I haven't measured the performance yet, but noticeably compiling takes less time.<br />
<br />
I still need to collect these changes and post a patch for this and allow other people to test it out for themselves. I also have to find how I can debug FreeCAD after compiling with Clang - it appears to be incompatible with GNU's gdb.<br />
<h4 style="text-align: left;">
<br /></h4>
<h4 style="text-align: left;">
Other Progress (slightly off-topic):</h4>
Workload seems to have increased once again at University. I spent a bit more time at the weekend on the Drawing Module: the majority of the work is looking at projecting faces onto the drawing plane. This is relatively similar to before but requires further work to sort edges into order, store these in a general format and then drawing using Qt's painter system. There's still work to do, but when I get that complete can hopefully share it.<br />
<br />
<h4 style="text-align: left;">
What is Clang?</h4>
<div>
<a href="http://clang.llvm.org/">Clang </a>is an alternative compiler that use <a href="http://llvm.org/">LLVM</a> to compile a variety of programming langaguesusing runtime optimisation methods. LLVM is used heavily in Mac OS X to improve graphics performance applications, but is also used in a handful of open source projects - in particular Open Source graphics drivers. LLVM provides the possibility to compile many different programming languages from Python, Fotran, OpenCL and importantly for this post c / c++.</div>
<div>
<br /></div>
<div>
Clang provides the infrastructure for compiling c++ and aims to offer a better alternative to gnu's gcc in terms of performance, better usability to developers and other advanced features such as static code checking. I won't say much more, but it seems a good alternative and therefore I decided to look at compiling FreeCAD using Clang.</div>
<div>
<br /></div>
<div>
<h4 style="text-align: left;">
What I did?</h4>
</div>
<div>
<ol style="text-align: left;">
<li>Install Clang</li>
<li>Change default compiler for make tool chain</li>
<li>Change some of the check inside CMakeList.txt file</li>
<li>(Ubuntu) Add a symlink for libgfortran for the linker to correctly work</li>
</ol>
<h4 style="text-align: left;">
Selecting the default compiler for your system (Ubuntu)</h4>
</div>
<div>
Most importantly install clang on your system. It seems that with Ubuntu installing clang introduces a an unwanted dependency of gcc 4.6. Once installed, depending on your system you can inform Cmake explicitly to use clang or alternatively you can change the system wide default for make to use the clang compiler.The first option is obviously the most sensible, but I am not sure of the command.</div>
<div>
<br /></div>
<div>
The only help I have seen on setting the compiler is the following <a href="http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake">stackoverflow question</a>:</div>
<div>
<br /></div>
<div>
In Ubuntu, it is straighforward to update the system wide compiler use for c++, simply run<br />
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">sudo update-alternatives --config c++</span></pre>
</div>
<div>
<br />
This will bring up an interface to select the compiler you wish to use:<br />
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJkbS1LH-d6MAc9Y3dsHkHH0-Uxx439NHZHuRcPPDolsnz0PhWPxzWhOrwrBWa9yBOms5FTjGHHEiqB2SonyfCrKUgyEyTt7DaTpeip_oBv58iThWFbmobKxoYGYMYbQVexdjLlfj_cM/s1600/oce3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJkbS1LH-d6MAc9Y3dsHkHH0-Uxx439NHZHuRcPPDolsnz0PhWPxzWhOrwrBWa9yBOms5FTjGHHEiqB2SonyfCrKUgyEyTt7DaTpeip_oBv58iThWFbmobKxoYGYMYbQVexdjLlfj_cM/s1600/oce3.png" /></a></div>
<div>
<br /></div>
<div>
I need to post the patches to CMake, hopefully soon and these can be verified by other users. </div>
<div>
<br /></div>
<div>
Following this, configure using cmake and then attempt to build using clang. You may notice that there is a linking error for lgfortran and then the build system fails. I think this is an issue with Ubuntu, but to solve this I had to create a symlink to gfortran library which isn't very convenient.</div>
<div>
<br /></div>
<div>
<div style="background-color: white; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px; line-height: 18px;">
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font: inherit; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.so libgfortran.so</span></pre>
<div>
<br /></div>
</div>
</div>
<div>
Hopefully FreeCAD should happily compile very fast now at blinding speed!<br />
<br />
<h3 style="text-align: left;">
----Update---</h3>
<br />
I have spent some time last week to look at some further details.<br />
<br />
<h4 style="text-align: left;">
Compiling using Clang per project:</h4>
</div>
<div>
There is an advanced option within CMake to specify what compiler to use for c and c++ per project build. Fortunately KDevelop makes this rather easy: Open Project Configuration by right clicking on the project to open the following dialog:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_s5zOuPPk3GlQY9mr9wCldQSm3xTfd66mBu8fSAkFPiE0w-OEPXolMzzgVF6C5-wu9skEeaPEFhRC4_kSZ5nQfLMndSgNhui9B3ywHg3SbLagGIKUKgsGS1Gb8QKALUTn4GYTuA_q6t8/s1600/oce4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="396" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_s5zOuPPk3GlQY9mr9wCldQSm3xTfd66mBu8fSAkFPiE0w-OEPXolMzzgVF6C5-wu9skEeaPEFhRC4_kSZ5nQfLMndSgNhui9B3ywHg3SbLagGIKUKgsGS1Gb8QKALUTn4GYTuA_q6t8/s640/oce4.png" width="640" /></a></div>
<br /></div>
<div>
Click '<b>Show Advanced Values</b>' and then set the following variable:<br />
<br />
<ul style="text-align: left;">
<li><b>CMAKE_CXX_COMPILER</b> = <b>/usr/bin/clang++ </b></li>
<li><b>CMAKE_C_COMPILER</b> to <b>/usr/bin/clang</b></li>
</ul>
<br />
Compiler flags can be conveniently set in <b>CMAKE_CXX_FLAGS</b>, where for both gnu compiler and clang <b>-g</b> is for full debug.<br />
<br />
<h4 style="text-align: left;">
Specifying Variables in the command line</h4>
It can also be done in the command line - I found really straightforward Guide for setting Variables in Cmake from (<a href="http://www.llvm.org/docs/CMake.html#id8">http://www.llvm.org/docs/CMake.html#id8</a>)<br />
<br />
<br />
<div style="background-color: white; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.5em; margin-top: 0.8em;">
Variables are set quite easily - simply prepend -D before the variable name and assign the value like so</div>
<div style="background-color: white; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.5em; margin-top: 0.8em;">
</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cmake -DVARIABLE=value</span></pre>
</div>
<div>
Alternatively, you can specify the type of the variable below:</div>
<div style="background-color: white; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.5em; margin-top: 0.8em;">
</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cmake -DVARIABLE:TYPE=value</span></pre>
</div>
<div>
<h3 style="text-align: left;">
<br />Debugging with Clang:</h3>
</div>
</div>
<div>
Unfortunatly there is currently a bug that is preventing gdb being used with clang, which is apparently fixed in the latest release. I tried to get this too compile but I encountered errors. Hopefully with the next release of LLVM and Clang 3.3, the issue will be resolved. </div>
</div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-3568291563212135099.post-77167494185399438672013-02-17T04:13:00.000-08:002013-03-02T07:58:46.437-08:00Compile OpenCASCADE Community Edition the Easy Way! (Update)<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Introduction:</h3>
After a very late last night as a result from the following: splitting my head for three hours on Finite Element Modelling and for some reason watching Back to the Future:Part II whilst figuring out some code for the section plane, unbelievably I managed to wake up reasonably fresh.<br />
<br />
Before starting on the chore of further University work this afternoon. I've been playing with compiling OpenCascade Community Edition in attempt to remove the shackles of Ubuntu's dictated policy of offering old packages.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghven41LoZd94f_9kMOq5-hpW3-tfpA7FEaocTUh9FPDE1WV-PYRnQBNP2nK2rHFwR7saN_o_HnMRRPLWxZmr_Td8EAvjgILNuHNVEr6-LSXsPWGTvBF2L9Zq3VNVtuRvLw_d82EPXdGk/s1600/bridezilla-ball-and-chain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghven41LoZd94f_9kMOq5-hpW3-tfpA7FEaocTUh9FPDE1WV-PYRnQBNP2nK2rHFwR7saN_o_HnMRRPLWxZmr_Td8EAvjgILNuHNVEr6-LSXsPWGTvBF2L9Zq3VNVtuRvLw_d82EPXdGk/s320/bridezilla-ball-and-chain.png" width="320" /></a></div>
<br />
<br />
All of this was inspired by a message on IRC #freecad over the past week about compiling OpenCascade with debug flags, so we actually have useful output when OpenCascade crashes without a warning (mostly from an unhandled exceptions on our part).<br />
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Benefits:</h3>
<ul style="text-align: left;">
<li>The other benefits are testing some new features - only recently has a commit been made to improve performance of boolean operations that will soon be merged - see <a href="https://groups.google.com/forum/?fromgroups=#!topic/oce-dev/fGZcIIzeKhA">discussusion</a></li>
<li>Full debug build so we can trace crashes correctly</li>
<li>Living life on the edge of your seat!</li>
</ul>
<br />
The first compile went really well, however, after attempting to compile FreeCAD I found that there were a few missing libraries that prevent FreeCAD from building. These were the visualisation and Model Exachange packages used by SMESH and Part for the IGES and STEP formats import. I am not sure if these should have been detected by FreeCAD's cmake but anyway, trial and error prevails.<br />
<br />
I also attempted to build OCE using TBB which is a threading library that can be used to speed up operations, however from what I read this is only used in a few algorithms.<br />
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Note:</h3>
Compiling OpenCascade does take a long time, around probably 50% longer than FreeCAD for a clean build. On my six core AMD Bulldozer computer, it took in the region of <b>18 minutes in total to compile</b> with each core at 100%. Also remember that you will need additional time to compile FreeCAD again. Once this has been done, recompiling is very quick.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibDc6kCI5Zd5KHrqqB2DxLqIRPkZorAcxxr_hNmp2O4779ueuMhD5tCrnoooXjV-CePqOQPTKOhHUfPnNsnYzYta_QMXjGkIMJP71-R5a59GhlYb3gRC92FCK9kTVghGv2eIFBheMhHmo/s1600/oce.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibDc6kCI5Zd5KHrqqB2DxLqIRPkZorAcxxr_hNmp2O4779ueuMhD5tCrnoooXjV-CePqOQPTKOhHUfPnNsnYzYta_QMXjGkIMJP71-R5a59GhlYb3gRC92FCK9kTVghGv2eIFBheMhHmo/s640/oce.png" width="640" /></a></div>
<br />
<br />
Be prepared to find something useful to do in the mean and drink tea or even a beer for a good half an hour.<br />
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Compiling OCE OpenCascade Community Edition (Easy Guide):</h3>
<i><b><br /></b></i>
<i><b>Reminder: expect 20-30 Minutes to compile:</b></i><br />
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Clone the repository:</h4>
<div>
Grab the latest git source from the official Open Cascascade Community Edition from the github page. The source is around 240mb when fully expanded and may take a while to download on a slow internet connection.</div>
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">git clone https://github.com/tpaviot/oce.git</span></pre>
<br />
<h4>
Create a build directory:</h4>
<div>
Create a suitable build directory, this can be in the main source folder but preferably outside to prevent potential conflicts</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span style="color: white;"><span style="white-space: pre-wrap;">mkdir oceBuild && cd oceBuild</span></span></pre>
</div>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Install libftgl-dev in Package Manager:</h4>
<div>
You need to install following development package for libftgl to compile the Visualisation Package in OCE. This will depend on your Distribution. </div>
<div>
<h4>
</h4>
<h4>
</h4>
<h4>
Install libtb2 & libtbb-dev in Package Manager:</h4>
<div>
For enabling <a href="http://threadingbuildingblocks.org/">TBB </a>- Threaded Building Blocks Library to be used in multithreading, you will need to ensure that these are installed on your system. Below are the package names in Ubuntu.</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNxSwZgbXwT-jv0RBtB6zAg6oTcuTlIUunVCcGOKvrQsAVbG-oP8W4710yGriePnQm1zg58nqybgG_U12Fr76l1Y0FaEqrkjX_xBHuUBN4g2C3ScOhfa_pSoZGFJXrfWUfZ8pB5tY50L0/s1600/oce2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNxSwZgbXwT-jv0RBtB6zAg6oTcuTlIUunVCcGOKvrQsAVbG-oP8W4710yGriePnQm1zg58nqybgG_U12Fr76l1Y0FaEqrkjX_xBHuUBN4g2C3ScOhfa_pSoZGFJXrfWUfZ8pB5tY50L0/s640/oce2.png" width="640" /></a></div>
<h4>
</h4>
<h4>
</h4>
<h4>
Remove any previous Opencascade libraries provided by distro:</h4>
<div>
I don't think OpenCascade and OCE can be run in parallel on the same machine - correct me if I'm wrong. Therefore you will need to remove any of these on your system. </div>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Configure the sources using CMake</h4>
<div>
Configure the OCE sources running the following cmake command in the current directory. This will install OCE to your /usr directory. </div>
<div>
<br /></div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/ \
-DOCE_INSTALL_PREFIX:PATH=/usr/ \
-DOCE_WITH_FREEIMAGE=OFF \
-DOCE_WITH_GL2PS=OFF \
-DOCE_VISUALISATION=ON \
-DOCE_DATAEXCHANGE=ON \
-DOCE_MULTITHREAD_LIBRARY=TBB \
-DCMAKE_BUILD_TYPE=Debug \
../oce</span></pre>
</div>
<div>
<br />
If you're installing on Ubuntu or Debian based distribution, it's advisable to change the install directory to /usr/local to isolate user compiled packages (@yorik) - (I need to confirm if FreeCAD can detect the location of the OCE header files from the location)<br />
<br />
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \</span></pre>
<br />
You may find that there are some missing development dependencies, so if there are you will have to install these using your package manager. I found generally if you could install FreeCAD you wouldn't experience any problems atleast on Ubuntu.</div>
<div>
<br /></div>
<h4 style="text-align: left;">
Create a release build (Improve Performance):</h4>
<div>
You may not want debug flags enabled so that you can have full compiler optimisations and full performance when using FreeCAD: change the line previously from</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">DCMAKE_BUILD_TYPE=Debug \</span></pre>
</div>
<div>
to</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">DCMAKE_BUILD_TYPE=Release \ </span></pre>
</div>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Begin Compiling:</h4>
<div>
When you start compiling OCE be prepared to wait a while. Replace <b>6</b> with the number of cores or independent threads that can be run on your computer to speed up compiling by running concurrent make operations.</div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">make -j6 -pipe</span></pre>
</div>
<h4 style="text-align: left;">
<i><span style="font-weight: normal;">There has been some discussion whether the '</span><b>-pipe</b><span style="font-weight: normal;">' argument can reduce compiling times. If someone has enough time to make a comparison with OCE it would be interesting to see the difference.</span></i></h4>
<div>
<h4>
</h4>
<h4>
</h4>
<h4>
Install:</h4>
</div>
<div>
Usually I install any compiled software to my user directory, but that wouldn't be straightforward. Therefore CMake was configured to install to /usr directory for simplicity later on. </div>
<div>
</div>
<div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">sudo make install</span></pre>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;"> </span></pre>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;"> </span></pre>
<h4>
Installing on Debain / Ubuntu Systems:</h4>
<div style="text-align: left;">
Another helpful hint from @yorik is to install using the built in utility <b>checkinstall</b>. This provides a convenient method of uninstalling OCE using the system's package manager. Once you have finished compiling, run the following command:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
sudo checkinstall </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Type (y) to accept the defaults, then you will be presented with a menu to further describe the package - do this at your own leisure:</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Once checkinstall is completed - this will take a while, it will produce a .deb package and OCE will have been installed to your system and registered in your system package manager. </div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;"> </span></pre>
</div>
</div>
<h4 style="text-align: left;">
Recompile FreeCAD:</h4>
<div>
There will be changes to the development sources since we are using a different edition of OpenCascade with FreeCAD. You will need to clean all the sources. From your previous FreeCAD build directory make sure run the following before recompiling (see previous <a href="http://freecadamusements.blogspot.co.uk/2012/08/help-us-test-freecad.html">post</a> on compiling FreeCAD :</div>
<div>
<div>
<br /></div>
<div>
<div>
<pre class="command-line" style="-webkit-background-clip: padding-box; -webkit-font-smoothing: auto; background-clip: padding-box; background-color: #333333; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 2px solid rgb(221, 221, 221); font-size: 13px; font: inherit; line-height: 18px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px; text-align: -webkit-auto; vertical-align: baseline;"><span class="tooltip" style="-webkit-background-clip: padding-box; background-color: #444444; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 0px; color: white; display: inline-block; font: inherit; margin: 0px 0px 0px -2px; padding: 0px 2px; position: relative; vertical-align: baseline; white-space: pre-wrap;">sudo make clean</span></pre>
</div>
</div>
<div>
<br /></div>
<div>
If OCE was compiled and installed correctly, whilst configuring FreeCAD you will find the following log message (<b>OpenCASCADE Community Edition has been found</b>):</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfj2gGh1RoWkTjjKxvFo0-qmEl5vb6fkTbLBDdGluFyi1jj-CVwgAnQTz5L9E5c0Xd69X_R2PBoLS_Zc9RQp5HqYZX3Zo8hRH4qkNtkM6od6QeJcQtQYBSVSADB38SrWNFooU-_8gYlRM/s1600/oce1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="74" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfj2gGh1RoWkTjjKxvFo0-qmEl5vb6fkTbLBDdGluFyi1jj-CVwgAnQTz5L9E5c0Xd69X_R2PBoLS_Zc9RQp5HqYZX3Zo8hRH4qkNtkM6od6QeJcQtQYBSVSADB38SrWNFooU-_8gYlRM/s640/oce1.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Recompile once again and you should have FreeCAD working with the latest OCE!</b></div>
<div>
<br /></div>
<div>
<i>Hopefully people will have understand the guide and will now have a working version of OCE that is is used by FreeCAD. If there seems to be problems or something isn't clear, please let me know and I will update the guide. </i></div>
<div>
</div>
</div>
<br /></div>
Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-3568291563212135099.post-15904661784975313352013-02-16T07:54:00.001-08:002013-02-16T07:54:26.349-08:00Drawing Module: Section Views<div dir="ltr" style="text-align: left;" trbidi="on">
This past week has been a tremendously busy one at University, but in the few bits of time I do have available, I have been looking at incorporating section views into my experiments on the Drawing Module. For those unfamiliar what a 'Section' views, below is an example. These are highly important in mechanical design and allow complex features to be seen and also annotated<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://homepages.cae.wisc.edu/~me231/online_notes/section_views/gif/sec2.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://homepages.cae.wisc.edu/~me231/online_notes/section_views/gif/sec2.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sectional View Along Axis A-A</td></tr>
</tbody></table>
Yorik, already did some work within his arch module purely using the python capabilities within FreeCAD. This can be used in the latest release of 0.13. His solution is simple but works well. Below is a representation of the sectioning algorithm (I am currently waiting for a download to finish so found the time to draw it)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqnE8ReZl1DBWTwxBzSh1cPB_VAytIap-4FIMu3crvlCPBzmz2pv3hRFKNma_m682vF97WENZbyKByeEFCKlq904nkqmYxB_G2fr0Q6BJ2cjg7rjwiCvKZqUDQVZzI8MZG8UzmsPM4dA/s1600/text4140.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqnE8ReZl1DBWTwxBzSh1cPB_VAytIap-4FIMu3crvlCPBzmz2pv3hRFKNma_m682vF97WENZbyKByeEFCKlq904nkqmYxB_G2fr0Q6BJ2cjg7rjwiCvKZqUDQVZzI8MZG8UzmsPM4dA/s1600/text4140.png" /></a></div>
<ol style="text-align: left;">
<li class="separator" style="clear: both; text-align: left;">The user defines a 3D plane. The 3D Plane is then checked to see if it intersects with the object</li>
<li>The bounding box for the FreeCAD part is then projected onto the cutting plane - there are 8 points.</li>
<li>The maximum size of each projection on the principal axes of the plane are found. These are then turned into an extruded box prism and a boolean cut operation leaves the remaining part.</li>
<li>The remaining sectioned part remains. The faces are then projected and if they are coincident with the cutting plane it will be sectioned face.</li>
</ol>
Interestingly enough I decided to mimic such behavior in the Sectioned View of this. Although relatively simple, in c++ requires finding the correct modeling algorithms in OpenCascade. After some mind boggling, I eventually got something crude to work.<br />
<br />
The functionality I am aiming towards is something similar to the functionality in other commercial CAD packages (namely Solidworks). My view is that using a 3D plane to section an object can be slightly tedious and awkward - atleast until we get a plane feature with the arrival on the Assembly Module. Instead I think it is more practical to create a section in the 2D Drawing User Interface.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGA_DoZaf5Jj5uMufVUc8qESagJNQT81OLDDY39aV0yLi2PZSfda72_jStx40NOb3hVRMX5Jv9WIgItDS0tGQ9K9r6imQIE3U3Adl2xbjSTRziK_tz_f7MQaY4mJByhvSIgpCQPxhLQk/s1600/text4198.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWGA_DoZaf5Jj5uMufVUc8qESagJNQT81OLDDY39aV0yLi2PZSfda72_jStx40NOb3hVRMX5Jv9WIgItDS0tGQ9K9r6imQIE3U3Adl2xbjSTRziK_tz_f7MQaY4mJByhvSIgpCQPxhLQk/s1600/text4198.png" /></a></div>
<br />
The user can create both 3D and Orthographic projections of the object and the user will 'draw' a section line AA in 2D. Upon completion this will create a new 'Section' View to the side that can be freely positioned.<br />
<br />
<em>The section plane is calculated simply by taking the cross product of the current view normal and the line, which produces the new normal of the plane.</em> <br />
<br />
This would hopefully cover most cases, but it should also allow an arbitrary plane to be set to create more flexibility when sectioning. <br />
<br />
The one complication that arises is that references will be lost because of the boolean operation. This will be of concern atleast until we get the more robust naming mechanism.<br />
<br />
<h3 style="text-align: left;">
Hatching:</h3>
Any sectioned faces or even chosen ones should be fillable with a hatch pattern. This can be detected automatically if the face is coincident on the plane. I haven't yet decided the approach for storing hatching information but should be relatively straight forward.<br />
<br />
<em>I am hoping to get some more of this done tonight or tomorrow and have something to show but that all depends on University work...</em> </div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-3568291563212135099.post-57895875517427577962013-02-12T15:10:00.002-08:002013-02-12T15:38:26.076-08:00FreeCAD 0.13 Official Release Available<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; font-family: inherit; line-height: 18px;">A big congratulations to everyone who has helped make our latest 0.13 release possible! This include all the contributors who have helped develop, code, build and of course our endless list of patient users who have been diligently testing our development snapshots.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPJyJXvuPE6RYoHRhk_yB44t75vFKtZucu0F7nlwQU241d1qD-oaq5eSP_MWFJvXAm4hkqPab1JTuW6OQxuRYmUcFXAtkQT9GAEOVkmR9l0rxfPGQ1MOn3cm4izQpL1pdHLDMYPvDLclQ/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPJyJXvuPE6RYoHRhk_yB44t75vFKtZucu0F7nlwQU241d1qD-oaq5eSP_MWFJvXAm4hkqPab1JTuW6OQxuRYmUcFXAtkQT9GAEOVkmR9l0rxfPGQ1MOn3cm4izQpL1pdHLDMYPvDLclQ/s1600/Untitled.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<span style="background-color: white; font-family: inherit;"><span style="line-height: 18px;">There has been so many improvements throughout the whole application. Many new features have been added and further performance and stability improvements in sketcher has been achieved over the year. The </span><a href="http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Release_notes_013" style="line-height: 18px;">release notes</a><span style="line-height: 18px;"> give a snapshot of what has been achieved over the past year. I stand now still finding it unbelievable how much momentum we have gained over the past year. </span></span></div>
<br />
<span style="font-family: Arial, sans-serif;"></span><br />
<div style="text-align: left;">
<span style="font-family: inherit; line-height: 18px;">It isn't official but we may decide to back-port improvements and bug fixes for the relatively stable 0.13 release now. </span><br />
<span style="font-family: inherit; line-height: 18px;"><br /></span></div>
<div style="text-align: left;">
<h3 style="text-align: left;">
<span style="background-color: white; font-family: inherit; line-height: 18px;">The Future: The long road ahead</span></h3>
</div>
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="background-color: white; line-height: 18px;">The future looks very promising, with numerous cool features in the works! The most anticipated</span><span style="background-color: white; line-height: 18px;"> being the </span><a href="http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Assembly_project" style="background-color: white; line-height: 18px;">Assembly Project</a><span style="background-color: white; line-height: 18px;">. This is not to mention my render workbench and some other improvements that are hidden away in my git repos which are waiting further testing and refinement. My personal motivation is to get someone to use my render module to produce a render of their design for the new FreeCAD splash screen!</span></span></div>
<div style="text-align: left;">
<span style="background-color: white;"><span style="font-family: inherit; line-height: 18px;"><br /></span></span></div>
<span style="background-color: white; font-family: inherit; line-height: 18px;">My pledge to everyone get involved, however you think you can! This doesn't have to be programming in python or c++, but there are many ways you can get involved</span><br />
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Test our development releases for bugs</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Help other users on the FreeCAD forums</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Create and publish tutorial guides</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Improve our documentation and translation efforts</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Design, Maintain and help our websites and promoting FreeCAD</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: inherit; line-height: 18px;">Package FreeCAD for Linux Distributions</span></li>
</ul>
</div>
Unknownnoreply@blogger.com0