Haskell-Things / ImplicitCAD

A math-inspired CAD program in haskell. CSG, bevels, and shells; 2D & 3D geometry; 2D gcode generation...
https://implicitcad.org/
GNU Affero General Public License v3.0
1.31k stars 141 forks source link

[OpenSCAD compat] Include relative paths are evaluated differently #276

Open depau opened 3 years ago

depau commented 3 years ago

Hi,

I was trying to rebuild this project (not the best code, I admit) with extopenscad with --fopenscad-compat and I noticed that relative imports are evaluated differently.

Specifically, OpenSCAD evaluates relative paths starting from the location of the SCAD file.

To reproduce: https://github.com/Depau/aegis-mini-skin; run make SCAD='./path/to/extopenscad -O':

$ make SCADC='/usr/bin/extopenscad -O'
/usr/bin/extopenscad -O -o stl/stubs/decoration_side.stl stubs/decoration_side.scad
Loading File.
Processing File.
extopenscad: /tmp/aegis-mini-skin/../config.scad: openFile: does not exist (No such file or directory)

⇒ OpenSCAD would load config.scad from /tmp/aegis-mini-skin/stubs/../config.scad


Side note: someone made an Arch Linux AUR package for ImplicitCAD, if you wanna mention it in the website :) https://aur.archlinux.org/packages/implicitcad/

julialongtin commented 3 years ago

I believe it's fair to call this broken. :)

lepsa commented 2 months ago

I've made a fix for this that should resolve the issue.