Kann FreeCad auch 3D-PDF-Dateien erzeugen?

In diesem Forum Fragen und Diskussionen in Deutsch
Forum rules
Foren-Regeln und hilfreiche Informationen

WICHTIG: Bitte zuerst lesen, bevor Sie posten
Hubertus
Posts: 28
Joined: Sat Apr 16, 2022 10:52 am
Location: Duderstadt
Contact:

Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by Hubertus »

Kann FreeCad auch 3 D-PDF-Dateien erzeugen?
Viele Anwender, mit denen man Dateien teilen möchte, haben ja kein 3-D Programm zur Verfügung.
Einen Adobe Reader hat fast jeder.
Anbei eine Beispieldatei.
Attachments
6.png
6.png (102.76 KiB) Viewed 2299 times
Gardena 2 mit AC erzeugt.pdf
(239.31 KiB) Downloaded 41 times
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by thomas-neemann »

Hubertus wrote: Sun Apr 24, 2022 12:19 pm Kann FreeCad auch 3 D-PDF-Dateien erzeugen?
...
in freecad kenne ich keine möglichkeit. 3d pdf war früher notwendig, weil es von vielen cad systemen keine kostenlosen viewer gab. mit freecad ist es anders. jeder kann es benutzen und deshalb braucht man es bei freecad eigentlich nicht mehr.

wenn es trotzdem gewünscht ist, würde ich es über sketchup erzeugen

https://www.youtube.com/watch?v=CqFQP5qVMd4

phpBB [video]
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by chrisb »

Irgendwo im Forum findest Du einen Beitrag von mir, wie man 3D-PDF erzeugt. Leider kann der Acrobat-Reader das wohl nicht für alle Betriebssysteme. Ich würde eher eines der WebGL-Formate wählen, einen Browser hat ja schließlich auch jeder. Da kann man die Objekte zwar nicht so schön in ein Dokument einbinden, aber man kann sie ganz gut anschauen.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Hubertus
Posts: 28
Joined: Sat Apr 16, 2022 10:52 am
Location: Duderstadt
Contact:

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by Hubertus »

Dankeschön für deine Info.
Welches Dateiformat ist nach deiner Meinung geläufig und für die 3D Anwendung gut geeignet?
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by chrisb »

Hubertus wrote: Sun Apr 24, 2022 3:41 pm Welches Dateiformat ist nach deiner Meinung geläufig und für die 3D Anwendung gut geeignet?
WebGL.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by wmayer »

Hubertus wrote: Sun Apr 24, 2022 3:41 pm Dankeschön für deine Info.
Welches Dateiformat ist nach deiner Meinung geläufig und für die 3D Anwendung gut geeignet?
FreeCAD kann direkt WebGL/X3D-Dukumente erzeugen. Das Dateiformat ist .xhtml.

3D-PDF-Dokumente zu erzeugen, war in der Vergangenheit immer etwas mühselig, weil es mehrere Schritte erfordert hat. Zunächst musste man ein Objekt als .idtf exportieren, dann mit einem Tool in eine .u3d-Datei konvertieren und schlussendlich musste man noch eine .tex-Datei schreiben, das die .u3d-Datei einbindet und mit pdflatex die 3D-PDF-Datei erzeugt.

Das Programm MeshLab bringt den Konverter mit und erlaubt es, die .tex-Datei direkt zu erstellen. Man benötigt aber immer noch eine LaTeX-Installation, um dann die .pdf-Datei zu erstellen.

Vor einigen Jahren habe ich ein Programm geschrieben, mit dem man 3D-PDF-Dateien direkt erzeugen kann. Als Eingabedateien erwartet es diese im Dateiformat .bms -- das ist das FreeCAD-eigene Mesh-Format. Erzeugt wird die 3D-PDF-Datei dann mittels:

Code: Select all

mshtoprc Datei1.bms Datei2.bms ... -o Datei.pdf
kuseu
Posts: 1
Joined: Thu Oct 06, 2022 6:00 pm

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by kuseu »

thomas-neemann wrote: Sun Apr 24, 2022 12:54 pm
Hubertus wrote: Sun Apr 24, 2022 12:19 pm Kann FreeCad auch 3 D-PDF-Dateien erzeugen?
...
in freecad kenne ich keine möglichkeit. 3d pdf war früher notwendig, weil es von vielen cad systemen keine kostenlosen viewer gab. mit freecad ist es anders. jeder kann es benutzen und deshalb braucht man es bei freecad eigentlich nicht mehr.

wenn es trotzdem gewünscht ist, würde ich es über sketchup erzeugen

https://www.youtube.com/watch?v=CqFQP5qVMd4

phpBB [video]
In welcher Welt lebst Du denn?? Nicht jeder der Freecad lesen kann, ist auch in der Lage es zu bedienen. Ein 3D-PDF zu bedienen kriegen aber viele hin, vor allem viele die über Dein Projekt entscheiden. ODER??
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by chrisb »

kuseu wrote: Thu Oct 06, 2022 6:07 pm In welcher Welt lebst Du denn??
Hallo und willkommen im Forum. Wir freuen uns hier über einen gemaßigten Ton und tauschen uns gerne auf der Sachebene aus.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by easyw-fc »

wmayer wrote: Mon Apr 25, 2022 8:52 am Vor einigen Jahren habe ich ein Programm geschrieben, mit dem man 3D-PDF-Dateien direkt erzeugen kann. Als Eingabedateien erwartet es diese im Dateiformat .bms -- das ist das FreeCAD-eigene Mesh-Format. Erzeugt wird die 3D-PDF-Datei dann mittels:

Code: Select all

mshtoprc Datei1.bms Datei2.bms ... -o Datei.pdf
Hallo @wmayer, ich habe versucht, Ihren Konverter zu kompilieren (ich arbeite mit MSYS2)...
Hier die Schritte, die ich gemacht habe:

Code: Select all

userC@CAD MINGW64 ~
$ git clone https://github.com/wwmayer/Pdf3D.git
Cloning into 'Pdf3D'...
remote: Enumerating objects: 44, done.
remote: Counting objects: 100% (44/44), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 44 (delta 15), reused 38 (delta 13), pack-reused 0
Receiving objects: 100% (44/44), 43.50 KiB | 5.44 MiB/s, done.
Resolving deltas: 100% (15/15), done.

userC@CAD MINGW64 ~
$ cd Pdf3D

userC@CAD MINGW64 ~/Pdf3D
$ git submodule update --init --recursive
Submodule 'libPRC' (https://github.com/XenonofArcticus/libPRC) registered for path 'libPRC'
Submodule 'libharu' (https://github.com/libharu/libharu) registered for path 'libharu'
Cloning into '/home/userC/Pdf3D/libPRC'...
Cloning into '/home/userC/Pdf3D/libharu'...
Submodule path 'libPRC': checked out '474fe401e444804116021e5460365b9c0a2c0a2d'
Submodule path 'libharu': checked out 'd84867ebf9f3de6afd661d2cdaff102457fbc371'

userC@CAD MINGW64 ~/Pdf3D
$ cmake -G "MSYS Makefiles"
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.11")
-- Found PNG: C:/msys64/mingw64/lib/libpng.dll.a (found version "1.6.37")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/userC/Pdf3D

userC@CAD MINGW64 ~/Pdf3D
$ make
Scanning dependencies of target mshtopdf
[  1%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_annotation.obj
[  2%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_array.obj
[  4%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_binary.obj
[  5%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_boolean.obj
[  6%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_catalog.obj
[  8%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_destination.obj
[  9%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_dict.obj
[ 11%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_doc_png.obj
[ 12%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_doc.obj
[ 13%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder_cns.obj
[ 15%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder_cnt.obj
[ 16%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder_jp.obj
[ 18%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder_kr.obj
[ 19%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder.obj
[ 20%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encrypt.obj
[ 22%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encryptdict.obj
[ 23%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_error.obj
[ 25%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_ext_gstate.obj
[ 26%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_font_cid.obj
[ 27%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_font_tt.obj
[ 29%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_font_type1.obj
[ 30%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_font.obj
[ 31%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_base14.obj
[ 33%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_cid.obj
[ 34%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_cns.obj
[ 36%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_cnt.obj
[ 37%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_jp.obj
[ 38%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_kr.obj
[ 40%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_tt.obj
[ 41%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef_type1.obj
[ 43%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_fontdef.obj
[ 44%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_gstate.obj
[ 45%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_image_ccitt.obj
[ 47%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_image_png.obj
[ 48%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_image.obj
[ 50%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_info.obj
[ 51%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_list.obj
[ 52%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_mmgr.obj
[ 54%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_name.obj
[ 55%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_namedict.obj
[ 56%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_null.obj
[ 58%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_number.obj
[ 59%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_objects.obj
[ 61%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_outline.obj
[ 62%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_page_label.obj
[ 63%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_page_operator.obj
[ 65%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_pages.obj
[ 66%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_real.obj
[ 68%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_streams.obj
[ 69%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_string.obj
[ 70%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_u3d.obj
[ 72%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_utils.obj
[ 73%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_xref.obj
[ 75%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_pdfa.obj
[ 76%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_3dmeasure.obj
[ 77%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_exdata.obj
[ 79%] Building C object CMakeFiles/mshtopdf.dir/libharu/src/hpdf_encoder_utf.obj
[ 80%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/libPRC/libPRC.obj
[ 81%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/libPRC/PRCFile.obj
[ 83%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/libPRC/PRCNode.obj
[ 84%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/asymptote/PRCbitStream.obj
[ 86%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/asymptote/PRCdouble.obj
[ 87%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/asymptote/oPRCFile.obj
[ 88%] Building CXX object CMakeFiles/mshtopdf.dir/libPRC/src/asymptote/writePRC.obj
[ 90%] Building CXX object CMakeFiles/mshtopdf.dir/asymptote/PRCTools/bitData.obj
[ 91%] Building CXX object CMakeFiles/mshtopdf.dir/asymptote/PRCTools/describePRC.obj
[ 93%] Building CXX object CMakeFiles/mshtopdf.dir/asymptote/PRCTools/inflation.obj
[ 94%] Building CXX object CMakeFiles/mshtopdf.dir/asymptote/PRCTools/iPRCFile.obj
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc: In constructor 'iPRCFile::iPRCFile(std::istream&)':
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:152:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  152 |   cout << "File structure UUID " << (void*)(fileStructureUUID[0]) << ' ' << (void*)(fileStructureUUID[1]) << ' '
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:152:77: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  152 |   cout << "File structure UUID " << (void*)(fileStructureUUID[0]) << ' ' << (void*)(fileStructureUUID[1]) << ' '
      |                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:153:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  153 |       << (void*)(fileStructureUUID[2]) << ' ' << (void*)(fileStructureUUID[3]) << endl;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:153:50: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  153 |       << (void*)(fileStructureUUID[2]) << ' ' << (void*)(fileStructureUUID[3]) << endl;
      |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:156:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  156 |   cout << "Application UUID " << (void*)(applicationUUID[0]) << ' ' << (void*)(applicationUUID[1]) << ' '
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:156:72: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  156 |   cout << "Application UUID " << (void*)(applicationUUID[0]) << ' ' << (void*)(applicationUUID[1]) << ' '
      |                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:157:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  157 |       << (void*)(applicationUUID[2]) << ' ' << (void*)(applicationUUID[3]) << endl;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:157:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  157 |       << (void*)(applicationUUID[2]) << ' ' << (void*)(applicationUUID[3]) << endl;
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:167:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  167 |     cout << "\tFile structure UUID " << (void*)(info.UUID[0]) << ' ' << (void*)(info.UUID[1]) << ' '
      |                                         ^~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:167:73: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  167 |     cout << "\tFile structure UUID " << (void*)(info.UUID[0]) << ' ' << (void*)(info.UUID[1]) << ' '
      |                                                                         ^~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:168:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  168 |         << (void*)(info.UUID[2]) << ' ' << (void*)(info.UUID[3]) << endl;
      |            ^~~~~~~~~~~~~~~~~~~~~
C:/msys64/home/userC/Pdf3D/asymptote/PRCTools/iPRCFile.cc:168:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  168 |         << (void*)(info.UUID[2]) << ' ' << (void*)(info.UUID[3]) << endl;
      |                                            ^~~~~~~~~~~~~~~~~~~~~
[ 95%] Building CXX object CMakeFiles/mshtopdf.dir/mshtoprc/mshtoprc.obj
C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp: In function 'int main(int, char**)':
C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:299:78: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(String&, std::_Ios_Openmode)'
  299 |                 std::ifstream fstr(inputFile, std::ios::in | std::ios::binary);
      |                                                                              ^
In file included from C:/msys64/home/userC/Pdf3D/libPRC/src/asymptote/oPRCFile.h:26,
                 from C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:31:
C:/msys64/mingw64/include/c++/10.2.0/fstream:587:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  587 |       basic_ifstream(basic_ifstream&& __rhs)
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:587:7: note:   candidate expects 1 argument, 2 provided
C:/msys64/mingw64/include/c++/10.2.0/fstream:562:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
  562 |       basic_ifstream(const std::string& __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:562:41: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const string&' {aka 'const std::__cxx11::basic_string<char>&'}
  562 |       basic_ifstream(const std::string& __s,
      |                      ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:544:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  544 |       basic_ifstream(const wchar_t* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:544:37: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const wchar_t*'
  544 |       basic_ifstream(const wchar_t* __s,
      |                      ~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:529:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  529 |       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:529:34: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const char*'
  529 |       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
      |                      ~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:518:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]'
  518 |       basic_ifstream() : __istream_type(), _M_filebuf()
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:518:7: note:   candidate expects 0 arguments, 2 provided
C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:342:72: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(String&, std::_Ios_Openmode)'
  342 |         std::ofstream fstr(outputName, std::ios::out | std::ios::binary);
      |                                                                        ^
In file included from C:/msys64/home/userC/Pdf3D/libPRC/src/asymptote/oPRCFile.h:26,
                 from C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:31:
C:/msys64/mingw64/include/c++/10.2.0/fstream:850:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  850 |       basic_ofstream(basic_ofstream&& __rhs)
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:850:7: note:   candidate expects 1 argument, 2 provided
C:/msys64/mingw64/include/c++/10.2.0/fstream:825:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
  825 |       basic_ofstream(const std::string& __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:825:41: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const string&' {aka 'const std::__cxx11::basic_string<char>&'}
  825 |       basic_ofstream(const std::string& __s,
      |                      ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:807:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  807 |       basic_ofstream(const wchar_t* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:807:37: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const wchar_t*'
  807 |       basic_ofstream(const wchar_t* __s,
      |                      ~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:790:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  790 |       basic_ofstream(const char* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:790:34: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const char*'
  790 |       basic_ofstream(const char* __s,
      |                      ~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:779:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
  779 |       basic_ofstream(): __ostream_type(), _M_filebuf()
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:779:7: note:   candidate expects 0 arguments, 2 provided
C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:347:72: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(String&, std::_Ios_Openmode)'
  347 |         std::ofstream fstr(outputName, std::ios::out | std::ios::binary);
      |                                                                        ^
In file included from C:/msys64/home/userC/Pdf3D/libPRC/src/asymptote/oPRCFile.h:26,
                 from C:/msys64/home/userC/Pdf3D/mshtoprc/mshtoprc.cpp:31:
C:/msys64/mingw64/include/c++/10.2.0/fstream:850:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  850 |       basic_ofstream(basic_ofstream&& __rhs)
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:850:7: note:   candidate expects 1 argument, 2 provided
C:/msys64/mingw64/include/c++/10.2.0/fstream:825:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
  825 |       basic_ofstream(const std::string& __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:825:41: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const string&' {aka 'const std::__cxx11::basic_string<char>&'}
  825 |       basic_ofstream(const std::string& __s,
      |                      ~~~~~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:807:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  807 |       basic_ofstream(const wchar_t* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:807:37: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const wchar_t*'
  807 |       basic_ofstream(const wchar_t* __s,
      |                      ~~~~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:790:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
  790 |       basic_ofstream(const char* __s,
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:790:34: note:   no known conversion for argument 1 from 'String' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const char*'
  790 |       basic_ofstream(const char* __s,
      |                      ~~~~~~~~~~~~^~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:779:7: note: candidate: 'std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]'
  779 |       basic_ofstream(): __ostream_type(), _M_filebuf()
      |       ^~~~~~~~~~~~~~
C:/msys64/mingw64/include/c++/10.2.0/fstream:779:7: note:   candidate expects 0 arguments, 2 provided
make[2]: *** [CMakeFiles/mshtopdf.dir/build.make:966: CMakeFiles/mshtopdf.dir/mshtoprc/mshtoprc.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/mshtopdf.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

userC@CAD MINGW64 ~/Pdf3D
$
Würden Sie mir bitte ein paar Tipps geben?
(sorry for my German, but I used a web translator)
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Kann FreeCad auch 3D-PDF-Dateien erzeugen?

Post by wmayer »

It's a MinGW/MSYS specific problems and works well for MSVC under Windows or under Linux.

You have to apply this patch:

Code: Select all

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 515cefc..be68dc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,6 @@ include_directories(${CMAKE_SOURCE_DIR}/asymptote/PRCTools)
 add_executable(mshtopdf WIN32 ${MSHTOPDF_SRCS})
 target_link_libraries(mshtopdf ${ADDITIONAL_LIBRARIES})

-if(WIN32)
+if(MSVC)
    set_target_properties(mshtopdf PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
-endif(WIN32)
+endif(MSVC)
diff --git a/mshtoprc/mshtoprc.cpp b/mshtoprc/mshtoprc.cpp
index 883618c..dc08921 100644
--- a/mshtoprc/mshtoprc.cpp
+++ b/mshtoprc/mshtoprc.cpp
@@ -21,7 +21,7 @@
  IDTFConverter.exe  -en 1 -rzf 0 -pq 500 -input test.idtf -output test.u3d
 */

-#ifdef WIN32
+#ifdef _MSC_VER
 # pragma warning(disable : 4244)
 # define NOMINMAX
 # include <Windows.h>
EDIT:
https://github.com/wwmayer/Pdf3D/commit ... a90b1fcb02
Post Reply