<blockquote>
  <p>I'm guessing this has to do with providing a specific line/point width? Else they are too thin for intersection.</p>
</blockquote>

<p>Exactly. True points and lines have no spatial extent: a point is infinitely small, a line is infinitely thin. You can't intersect those with a ray. But a point with a size is just a sphere, and a line with a size is a cylinder, and those are classic ray-casting primitives, so of course you can intersect them.</p>

<p>The only difficulty is if your path-tracer currently only has one geometry primitive (the polygon or polygon mesh): adding new primitives might be hard for you, if you've structured it for just one. But even in that case, instead of intersecting the points and lines directly, you can just turn them both into polygon meshes inside the renderer, before casting any rays. If you know how to polygonise a sphere and a cylinder you already know what to do.</p>

CC BY-SA 4.0
2018-07-15T09:34:36.360Z
I haven't actually written the model loading part at all so I'm still open to ideas. My main approach was to load any model/scene through assimp and set a post processing option which "triangulates" anything having more than 3 indices. This assures I only need to check for ray-triangle intersection. However according to assimp it won't modify lines and points. 

Thus I wanted to know if ignoring these points and lines would make any real difference to the appearance of the model?
gallickgunner
CC BY-SA 4.0
2018-07-15T09:41:04.080Z
@wandering-warrior That depends on the particular model and the format you're loading. Try it on some models you're interested in and see what happens. Chances are they won't contain any points or lines anyway.
Dan Hulme
CC BY-SA 4.0
2018-07-15T08:43:07.363Z
2018-07-15T08:43:07.363Z
Dan Hulme
<p>So I'm in the midst of implementing a path-tracer. I have chosen to use Assimp library to load models and scene information.</p>

<p>According to it, it will provide mesh data and meshes may contain point, line, triangles and polygons primitives. It gives the option to triangulate polygons but I don't know what to do with lines and points. Should I ignore them?</p>

<p>This leads to a bigger question that came in my mind. Can we ray-trace points and lines? I wanted to use this kind of thing once to show my Bounding boxes in wire frame mode but didn't know how I would trace only the boundaries.</p>

<p>I'm guessing this has to do with providing a specific line/point width? Else they are too thin for intersection. </p>

<p>If we can render lines and points, then should I ignore them or not in my path tracer? Will I be missing out on details etc? Don't know what are they used to represent in 3D models as I have only seen triangles/polygons. </p>

<raytracing><geometry>
Pathtracing line and point primitives?
gallickgunner
# Pathtracing line and point primitives?

(Asked by: username_0 on 2018-07-15)

So I'm in the midst of implementing a path-tracer. I have chosen to use Assimp library to load models and scene information.

According to it, it will provide mesh data and meshes may contain point, line, triangles and polygons primitives. It gives the option to triangulate polygons but I don't know what to do with lines and points. Should I ignore them?

This leads to a bigger question that came in my mind. Can we ray-trace points and lines? I wanted to use this kind of thing once to show my Bounding boxes in wire frame mode but didn't know how I would trace only the boundaries.

I'm guessing this has to do with providing a specific line/point width? Else they are too thin for intersection.

If we can render lines and points, then should I ignore them or not in my path tracer? Will I be missing out on details etc? Don't know what are they used to represent in 3D models as I have only seen triangles/polygons.

**Tags:** raytracing, geometry


---

## 1 answers

### Answer by username_1 on 2018-07-15. Score: 1 | Accepted answer

> I'm guessing this has to do with providing a specific line/point width? Else they are too thin for intersection.

Exactly. True points and lines have no spatial extent: a point is infinitely small, a line is infinitely thin. You can't intersect those with a ray. But a point with a size is just a sphere, and a line with a size is a cylinder, and those are classic ray-casting primitives, so of course you can intersect them.

The only difficulty is if your path-tracer currently only has one geometry primitive (the polygon or polygon mesh): adding new primitives might be hard for you, if you've structured it for just one. But even in that case, instead of intersecting the points and lines directly, you can just turn them both into polygon meshes inside the renderer, before casting any rays. If you know how to polygonise a sphere and a cylinder you already know what to do.

> **Comments:**
> **username_0**: I haven't actually written the model loading part at all so I'm still open to ideas. My main approach was to load any model/scene through assimp and set a post processing option which "triangulates" anything having more than 3 indices. This assures I only need to check for ray-triangle intersection. However according to assimp it won't modify lines and points.   Thus I wanted to know if ignoring these points and lines would make any real difference to the appearance of the model?  
> **username_1**: @wandering-warrior That depends on the particular model and the format you're loading. Try it on some models you're interested in and see what happens. Chances are they won't contain any points or lines anyway.  

---

