View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004403||FreeCAD||Feature||public||2020-07-08 13:54||2021-02-06 06:49|
|Summary||0004403: import PRC file or 3D PDF into FreeCAD|
|Description||This is a follow up the suggestion I made in the forum.|
PRC files are commonly used by several vendors to embed 3D models in a PDF file. Unfortunately, these files can only be opened with Adobe PDF reader. For example, Linux does not have a native Adobe viewer, which means it is impossible to view correctly this type of documents. One needs some workarounds (Wine, Virtualbox, or old Adobe versions for Linux).
I thought that in general, not only for Linux users, it would be nice if FreeCAD would be able to import PRC files in the same way it imports STEP files. (Also including nested parts in the tree model).
It is easy to extract the embedded PRC file from the 3D PDF, by just searching for 'stream.PRC' and 'endstream' bytes in a hex editor, so in principle this could be done automatically also by FreeCAD. Everything inbetween is the PRC binary file that can be extracted, and for example included in your own PDF with pdflatex media9 package.
Thinking about a 'far future', if FreeCAD is able to open and import it, this would allow in the future that Linux PDF viewers display inline also 3D models, by embedding a small FreeCAD plugin directly, instead of having to open it in external FreeCAD window. In the same way than Adobe PDF reader has a Flash Player plugin to do that.
To implement this feature, one might reuse some parts of this code: https://github.com/XenonofArcticus/libPRC
The PRC file format is defined [url=https://web.archive.org/web/20091123055411/http://pdf.editme.com/files/PDFE/SC2N570-PRC-WD.pdf]here[/url].
Other posts related to generating PRC files from a FreeCAD model:
(This is the opposite direction than the feature requested here)
|Steps To Reproduce|
(Side note: if a 3D PDF file has several 3D models embedded, this has to be done in a for loop. Or the user has to select in the import dialog one among those)
|Tags||conversion, file format, import, STEP|
|FreeCAD Information||OS: Linux Mint 19.3 (MATE/mate)|
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21775 (Git) AppImage
Build type: Release
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
The following link is more updated than the one from libPRC I posted before.
One could expand the code in asymptote repository and write the functions in the opposite direction (Deserialize, Read) instead of (Serialize, Write). So that Asymptote library could be used as an 'intermediary'. Then, one would 'only' need to convert Asymptote structure to FreeCAD structure.
||See also: https://github.com/vectorgraphics/asymptote/issues/167|
|2020-07-08 13:54||ferdymercury||New Issue|
|2020-07-08 13:57||ferdymercury||Tag Attached: STEP|
|2020-07-08 13:58||ferdymercury||Tag Attached: file format|
|2020-07-08 13:58||ferdymercury||Tag Attached: conversion|
|2020-07-08 14:13||ferdymercury||Note Added: 0014636|
|2020-07-08 15:43||Kunda1||Tag Attached: import|
|2020-12-10 16:49||wmayer||Note Added: 0015124|
|2020-12-10 16:54||ferdymercury||Note Added: 0015125|
|2021-02-06 06:49||abdullah||Target Version||=> 0.20|