Graphics, Figures & TablesIntegration of Sketch

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
wombat33
Posts: 7
Joined: Tue Oct 29, 2013 9:51 am

Integration of Sketch

Post by wombat33 »

Hi,

I'm looking for a good way to create 3D diagrams of frustums etc. on a Mac. So far the best tool I've found is Sketch. The .sk package looks like a possibility but the figures are fairly large so running the interpreter on separate .sk files seems reasonable to avoid overhead. Currently I've built sketch from scratch. It creates the correct PDF if I run it like this.

Code: Select all

sketch -T sample.sk -o sample.tex
pdflatex sample.tex
Now I'm trying to integrate it into MacTeX. I think I want to get LaTeXmk to launch it then run pdfLaTeX on the resulting .tex file but so far no luck. I've modified .latexmkrc in the same directory as follows:

Code: Select all

add_cus_dep('sk', 'tex', 0, 'makesketch');
sub makesketch {
    system("sketch -T '$_[0]'.sk -o '$_[0]'.tex");
    system("pdflatex '$_[0]'.tex");
}
So far no luck. On running "latexmk -pdf" with just "example.sk" in the directory I get:

Code: Select all

Subroutine makesketch redefined at (eval 16) line 2, <GEN1> chunk 1.
Latexmk: This is Latexmk, John Collins, 11 Nov. 2012, version: 4.35.
**** Report bugs etc to John Collins <collins at phys.psu.edu>. ****

Latexmk: No file name specified, and I couldn't find any
Does someone know a way to get this working?

thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

wombat33
Posts: 7
Joined: Tue Oct 29, 2013 9:51 am

Re: Integration of Sketch

Post by wombat33 »

Just curious.. has anyone had any luck integrating with Python or another scripting language for this kind of work? It seems like it might be easier to throw the scene out to a scripting language to do the normal transforms then pulling it back in so the corresponding latex code outputs the primitives in back-to-front order.
wombat33
Posts: 7
Joined: Tue Oct 29, 2013 9:51 am

Re: Integration of Sketch

Post by wombat33 »

These look along the lines of what i'm looking for:
http://rainnic.altervista.org/content/e ... -latex-u3d .
http://www.astrobetter.com/tutorial-for ... -into-pdf/

I also see pst-solides3d for pstricks. It looks quite full-featured, but my current toolset is comfortable with pdflatex/xelatex/luatex so i haven't dug into it yet.

Probably old news to most.. please let me know if I've missed something..
wombat33
Posts: 7
Joined: Tue Oct 29, 2013 9:51 am

Re: Integration of Sketch

Post by wombat33 »

This may be sufficient for my current needs: http://mirror.unl.edu/ctan/macros/latex ... media9.pdf
wombat33
Posts: 7
Joined: Tue Oct 29, 2013 9:51 am

Re: Integration of Sketch

Post by wombat33 »

Daz Studio still appears to be the best bet for generating a u3d. In general this area is in a bit of disarray since Adobe sold its 3d development tools.

Although the title of the post is a bit misleading, i'll assume it's ok to mark this resolved. For my needs this solution is ok.
Post Reply