
Show HN: 3D Vector Graphics - fogleman
https://github.com/fogleman/ln
======
scrumper
This looks pretty great, I'll play with it. Can you explain this from the
Readme?

 _Unfortunately, it 's difficult to compute the joint formed at the boundaries
of these combined shapes, so sufficient texturing is needed on the original
solids for a decent result._

What is hard about computing the joint? Why does texturing help? My question
is from a perspective of curious ignorance, not arrogance (i.e. me saying
"don't be silly, it's easy.")

~~~
f2f
unless you're dealing with sufficiently large integers computing the intersect
between a line and a plane with any robustness is impossible on modern
computers with float or double. sometimes when you intersect meshes that have
nearly coplanar faces, the intersection might shoot vertices near some
infinity because of division inaccuracy.

~~~
zurn
Sufficiently large integers (and FP numbers too) are directly supported by
Go's standard library:
[https://golang.org/pkg/math/big/](https://golang.org/pkg/math/big/)

------
evmar
If you run into limitations with the Cairo binding you're using, I'd like to
shamelessly plug the one I wrote, which covers much more of the Cairo API:
[https://godoc.org/github.com/martine/gocairo/cairo](https://godoc.org/github.com/martine/gocairo/cairo)

~~~
fogleman
Nice. I love Cairo. I'll check it out.

------
philbarr
Whenever I see install instructions like this:

OS X

    
    
      brew install cairo pkg-config
      go get github.com/ungerik/go-cairo
    

Ubuntu

    
    
      sudo apt-get install libcairo2-dev pkg-config
      go get github.com/ungerik/go-cairo
    

... I always think there should be a "default" instruction page linked to
somewhere that explains what brew and apt-get are (and other things). I mean,
I know you can't be expected to go to the lengths of explaining this stuff for
every single project, but this is the kind of thing that will inspire the next
generation. So maybe we, as a community could come up with a, "you don't know
what this is? look here..." kind of page that people can put on their github
projects.

~~~
pradn
Wholeheartedly agreed. When I was learning about OSS, I had no idea what a
"pull request" was but people kept mentioning it. A standard guide on how OSS
works with Github, Linux, and related tools would be immensely helpful in
welcoming new developers into the OSS world.

~~~
pjc50
The google answer for "what is a pull request" is quite good.

------
WhiteNoiz3
That's pretty cool. A commandline app that just takes an .OBJ file and renders
it to an .SVG would actually be pretty useful (viewport position / orientation
would of course need to be options as well).

~~~
fogleman
Even cooler if I could figure out some general way of parameterizing &
texturing the surface instead of just rendering the triangles. Any ideas?

~~~
jasonwatkinspdx
Hughes Hoppe has done a variety of research that depends on finding
interesting parameterizations of meshes. His papers aren't exactly lightweight
on the math, but you may find some ideas there:

[http://research.microsoft.com/en-
us/um/people/hoppe/](http://research.microsoft.com/en-us/um/people/hoppe/)

[http://research.microsoft.com/en-
us/um/people/hoppe/proj/vfd...](http://research.microsoft.com/en-
us/um/people/hoppe/proj/vfdesign/)

[http://research.microsoft.com/en-
us/um/people/hoppe/proj/lap...](http://research.microsoft.com/en-
us/um/people/hoppe/proj/lapped/)

~~~
nikolay
Great! Hughes Hoppe's work is amazing!

~~~
theoh
Hugues Hoppe, unless he has changed his name.

~~~
jasonwatkinspdx
Shit. Thanks for your correction, I can no longer edit the above comment to
reflect it, sorry.

------
endgame
`ln` is a utility commonly used for making links. Searching for this project
in the future is going to be a pest.

~~~
mdup
One could argue that as a name, `go` is not optimal either, yet it seems the
community has worked around it pretty well.

------
echelon
This is fantastic! I think I can use this in my laser projection work. :)

~~~
fogleman
Glad to hear. Let me know if you have any questions.

------
lukeadams
The output reminds me of Blender's Freestyle plugin. This looks great though
because it's not part of a software suite! ;)

[0]
[https://www.blender.org/manual/render/freestyle/export_svg.h...](https://www.blender.org/manual/render/freestyle/export_svg.html)

~~~
profeta
blender is, contrary to popular belief, extremely nimble and easy to
compile/modify.

it is all python, mostly.

and can be used a command line tool with very little effort. you can make a
"open obj file, put default camera, render" scripts very easily.

------
rmcpherson
I thought I remembered seeing your graphics work before in go posted on HN.
Yep: [https://github.com/fogleman/pt](https://github.com/fogleman/pt) Is this
an evolution of that work, at least in terms of the learning process?

~~~
w23j
This is amazing. I spent some time staring at he gopher picture in disbelieve.
'Mindblowing' would be the fitting description.

Then I scrolled down to the samples...

------
krcz
It might be an interesting idea to use similar algorithms to create vector
plots in scientific PDF documents, instead of having embedded raster images
that don't scale well.

------
kgabis
I just want to say that I'm a huge fan of your open source projects. Thanks
for sharing them!

~~~
phodo
Same here - Nice job. Craft (Minecraft in C / opengl) is a really cool
project. I didn't realize it was the same person until I went back through the
github repo just now.

------
artursapek
This is fantastic. I love programming geometry. This must be a lot of fun to
work on.

That gif at the bottom is mind bending
[https://camo.githubusercontent.com/9f83ca714a35fd2a08b85370f...](https://camo.githubusercontent.com/9f83ca714a35fd2a08b85370f8cb7410cc70a839/687474703a2f2f692e696d6775722e636f6d2f676b385574564b2e676966)

------
Patient0
Question: at the bottom of
[https://github.com/fogleman/ln/blob/master/ln/matrix.go](https://github.com/fogleman/ln/blob/master/ln/matrix.go)

Did you type that in manually?

I wonder if there's a way to do that in Go that doesn't have as much
duplication, but has the same performance?

~~~
fogleman
Probably found the algorithm somewhere and used multiple selection in Sublime
Text to quickly reformat it.

~~~
Patient0
Anyway I think your webpage is very impressive! Nice job!

------
nikolay
Thank you, @fogleman! We really love you work - including other projects!

~~~
fogleman
Thank you!

------
leni536
An other similar software is Sketch[1]. It generates tikz images that you can
compile in LaTeX.

[1]
[http://sketch4latex.sourceforge.net/](http://sketch4latex.sourceforge.net/)

------
santaclaus
That's pretty rad! I wonder what it would like to bake pre-rendered color
information onto the vector geometry. Even without textures on the models some
nice ambient occlusion could look cool.

------
Retr0spectrum
I'd love to see someone output this to an oscilloscope.

------
Hydraulix989
Have you considered using bilinear gradients to do shading?

~~~
Hydraulix989
Actually, that's not part of the standard yet, but at least somebody is
working on it:

[http://tavmjong.free.fr/blog/?p=316](http://tavmjong.free.fr/blog/?p=316)

------
dawnbreez
I wonder if there are any libraries or tools for making simple 3D
visualizations of data. Something like a 3-dimensional Conky.

------
Philipp__
Wow, this is amazing! Really, really nice work! Will read it and analyze it
in-depth, think I could learn thing or two...

------
IshKebab
Nice work!

