Recreating a Libre/Open Source Otoscope in FreeCAD

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby kisolre » Thu Aug 29, 2019 9:02 am

tarek wrote:
Thu Aug 29, 2019 6:54 am
Thanks for this. Interesting problem. I think at least it will work for some (I tested and it works on GNU/Linux), whereas with absolute paths it will work for none, right? Any other proposed solutions?
I expected it to work so probably something is buggy under windows. If @ChrisB could test under Mac it is probably worth reporting a bug.
chrisb wrote:Ping
openBrain
Posts: 2382
Joined: Fri Nov 09, 2018 5:38 pm

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby openBrain » Thu Aug 29, 2019 9:59 am

tarek wrote:
Thu Aug 29, 2019 6:56 am
eddriesen wrote:
Wed Aug 28, 2019 5:50 pm
Ow cr#p, there 'll be no fun left for me when I return home... :(
Hi Ed,
I think this is what we'd call a "good problem to have" :lol:
@eddriesen : you can ever review the models, do them better and throw stones to original designers... :lol: :lol: :lol:

In case it may be helpful to somebody, here how I "check" my FreeCAD models once done :
  1. Open the .OBJ file of the original object as alias mesh and go to Part WB
  2. Convert it to shape with Part -> Create shape from mesh
  3. Convert shape to solid with Part -> Convert to solid
  4. Refine the solid with Part -> Create a copy -> Refine shape
  5. Align the refined solid with the FreeCAD model using the Aligner tools of the Manipulator WB
  6. Use Inspection WB / Inspection -> Visual inspection. Select as "actual" the FreeCAD model and as "nominal" the refined solid. You can change the search range later in the property editor, starting with 100 or 200 µm is generally good.
Below are 2 examples obtained respectively with button lock part (20 µm search range) and handle cover one (50 µm search range, where the approximation of spline with arcs is visible in the groove) :
button_lock_20um.png
button_lock_20um.png (27.34 KiB) Viewed 628 times
handle_cover_50um.png
handle_cover_50um.png (24.81 KiB) Viewed 628 times
HTH
chrisb
Posts: 19645
Joined: Tue Mar 17, 2015 9:14 am

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby chrisb » Thu Aug 29, 2019 10:38 am

kisolre wrote:
Thu Aug 29, 2019 9:02 am
I expected it to work so probably something is buggy under windows. If @ChrisB could test under Mac it is probably worth reporting a bug.
Relative paths don't work on the mac for the font selection; well, not if they are relative to the model. I faintly remember models back in 0.17 (or was it even 0.16?) where I used to pack models and fonts together in the same directory.
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby kisolre » Thu Aug 29, 2019 1:48 pm

chrisb wrote:
Thu Aug 29, 2019 10:38 am
Relative paths don't work on the mac for the font selection
I meant if you select a file with file selection dialog and then recompute and font is Ok. Then you edit the font field by hand and change the path to be relative to the file (here there is assets 'sub folder where font is located so "assets/asimov.otf") and recompute the document does it pick the font again or throws an error?
TheMarkster wrote:
Wed Aug 28, 2019 4:34 pm
Those are the 3 I did
In the file "name_plate" the two shape strings have different paths - one is relative other is Windows absolute. Since the list shows you as the author does relative path work under your windows install? Here I tried several FreeCAD versions and several font locations (freecad bin folder, Draft.py folder, relative to freecad file path, ...) and nothing works as relative path.
chrisb
Posts: 19645
Joined: Tue Mar 17, 2015 9:14 am

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby chrisb » Thu Aug 29, 2019 3:05 pm

kisolre wrote:
Thu Aug 29, 2019 1:48 pm
Then you edit the font field by hand and change the path to be relative to the file (here there is assets 'sub folder where font is located so "assets/asimov.otf") and recompute the document does it pick the font again or throws an error?
That's exactly what I had done, relative to the model, and it throwed an error. If you are interested I can do it again and post the error.
chrisb
Posts: 19645
Joined: Tue Mar 17, 2015 9:14 am

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby chrisb » Thu Aug 29, 2019 3:21 pm

Ok, so we have indeed a regression. I tested with the slightly outdated version below and it can handle a font path of the form
myFontDirectory/fontfile.ttf which uses myFontDirectory below the current directory of the FreeCAD file.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
TheMarkster
Posts: 1061
Joined: Thu Apr 05, 2018 1:53 am

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby TheMarkster » Thu Aug 29, 2019 4:30 pm

The maintainers at github in charge of the project are the ones who changed it to a relative path. I had it in e:\downloads\fonts when I made the model.
openBrain
Posts: 2382
Joined: Fri Nov 09, 2018 5:38 pm

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby openBrain » Thu Aug 29, 2019 10:03 pm

PRed the button holder : https://github.com/GliaX/Otoscope/pull/12

Code: Select all

battery_holder <GlouGlou>
handle_cover <openBrain>
name_plate_locks <TheMarkster>
button_block <openBrain>
head_lock <TheMarkster>
name_plate <TheMarkster>
button_holder_bottom <eddriesen done>
inner_head
neck <openBrain>
button_holder <openBrain>
lens_holder_bottom
outer_head
button_lock <openBrain>
lens_holder_top
specula_holder <openBrain>
handle_coupler <eddriesen wip>
lens_jig NEEDS TO BE UPDATED FIRST
User avatar
Kunda1
Posts: 5937
Joined: Thu Jan 05, 2017 9:03 pm

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby Kunda1 » Thu Aug 29, 2019 11:04 pm

TheMarkster wrote:
Thu Aug 29, 2019 4:30 pm
The maintainers at github in charge of the project are the ones who changed it to a relative path. I had it in e:\downloads\fonts when I made the model.
tarek wrote:
Thu Aug 29, 2019 6:54 am
kisolre wrote:
Wed Aug 28, 2019 2:29 pm
Also relative path to font file does not work under windows. I tried "assets/asimov.otf" and "./assets/asimov.otf"
Thanks for this. Interesting problem. I think at least it will work for some (I tested and it works on GNU/Linux), whereas with absolute paths it will work for none, right? Any other proposed solutions?
chrisb wrote:
Thu Aug 29, 2019 3:21 pm
Ok, so we have indeed a regression. I tested with the slightly outdated version below and it can handle a font path of the form
myFontDirectory/fontfile.ttf which uses myFontDirectory below the current directory of the FreeCAD file.
This is all related to: issue #3254
Wrong paths to fonts occur when you exchange models between different systems. An 'Embed' option would be useful
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chrisb
Posts: 19645
Joined: Tue Mar 17, 2015 9:14 am

Re: Recreating a Libre/Open Source Otoscope in FreeCAD

Postby chrisb » Fri Aug 30, 2019 4:41 am

In June 2018 I had written that font files respect relative paths. I don't remember if I had written so after a new test or if I wrote so from previous experience. So maybe the regression occurred between June last year and now.