Giter Club home page Giter Club logo

Comments (10)

MarcusRoszak avatar MarcusRoszak commented on July 24, 2024 1

Many thanks!!!

Great job, works like a charm!
Looking through the code, I'm pretty sure you saved a lot of my time.

Have fun coding!
Marek

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024 1

OK, so looked into this a bit, downloaded PDF-XChange and tried to create PDF with default settings only. meaning no views definition, so relies on what's defined in the U3D file itself. attaching here the modified main.cpp (as zip, per attachments reqs), in case it'll be helpful to you
building.pdf
cube.pdf
main.zip

With this setup we're pretty much relying on what the u3d define for default view and hope for the best. I saw that in acrobat i can see both elements, albeit it's good to use the toolbar to change the background to white or light gray, and make sure the lighting is set to either CAD optimized lights or Primary Color lights. for PDFXchange, the building appears blank...but it's there, just change the lighting toe Primary Color lights, and change the background color to light gray and you'll see it [this seems to be a good setup also for the cube].

not sure there's a one size fit all solution here, because it is all pretty much dependent on the u3d files and what default views they define. but note that the initial example does show how to create your own views in the PDF which sets particular settings (like lighting and camera matrix) to customize the view). the PDF reference manual section 9.5.3 discusses the options you can put in a view. you can have a couple (as the initial example shows) and even choose one to appear on load as a default one (see the "Default" value for DV in the 3D dictionary definition in the example). i keep a useful link to dld the pdf reference manual here.

from pdf-writer.

MarcusRoszak avatar MarcusRoszak commented on July 24, 2024 1

Wow! Thanks a alot for the thorough answer.

I mean, I'm totally fresh in PDF creation. And I learent about the U3D format just last week, while researching the capabilities of your library. So. I was really thankful for your example and the fact that your library does support embedding of U3D in PDFs.
And did not have much time to play with your code too much, just incorporated it in my example code.

Now I think, I know enough to get started :)

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024

Cheers,
While i did remove the example i was able to locate the emailing i had with the guy i mentioned there.
created the folder with the example, updated the link there and here it is as well:
https://app.box.com/s/tpqf9jfmvxcw13gig0ljh9p31got1rqh

Gal.

from pdf-writer.

MarcusRoszak avatar MarcusRoszak commented on July 24, 2024

building
building.zip

Hi again,
I dared to reopen this issue :-P
I played around with it and tried to add different u3d files but only a very simple one got displayed.
Some of them cannot get displayed in the document. They are clearly in the document because their structure is recognized and can be listed.
But the 3D view is empty.

Would you be so kind and take a look at the attached U3D? It's one of those not working.
I wonder if it is a defect in the file, or if there's some setting that needs to be turned on/off?

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024

not sure why, but i cant seem to be able to open the zip file.

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024

also, maybe save me some time and provide both u3d object and the PDF generated

from pdf-writer.

MarcusRoszak avatar MarcusRoszak commented on July 24, 2024

testing-with-buidling.pdf
testing-with-cube.pdf
building.zip

Sorry, my bad with the zip file.
I attached it once again, as well as a PDF containing it and another one containg the cube that you provided.
What I found out is that Adobe's PDF viewer shows the building, although small and at the bottom of the page - probably some camera settings..
However, PDF-XChange Editor does not show the building, no matter what I tried. Yet, it does show the cube normally.
Might be, that PDF-XChange Editor has some issue.

If you find some time to take a look at it, it would fabulous :-)

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024

yeah, you probably dont want to use the exact same views definitions, but rather use those that are relevant to the model at hand. especially size and point of origin im guessing (not really a u3d or cad expert). i seem to detect that you just used the same views and i guess that's the point of issue. one thing to try is to start from a PDF that uses default views instead.

from pdf-writer.

galkahana avatar galkahana commented on July 24, 2024

with acrobat you can right click "part options"->"fit visible" to see the building properly sized.

from pdf-writer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.