Original Post
I have a convex volume which is defined as the intersection of a set of halfspaces; this representation is new to me (I'm used to having explicit geometry, e.g a boundary representation, to query against) and I'm a bit confused about how I would go about calculating ray intersection and distance-to-point queries for a convex volume formed by halfspaces.
For ray intersection, something that *sort of* works is to calculate the intersection of the ray vs each plane, and then at each intersection check if the intersection point is inside/behind all the other planes. This gives correct results, but seems pretty wasteful/slow; I'm hoping there's a better method someone could suggest.
For distance queries, I'm at even more of a loss: AFAICT all I can calculate from the halfspaces is a bunch of point-to-plane signed distances. For points inside of the convex volume, this works -- the closest point on the surface of the volume is just the point on one of the planes closest to the query point -- but for points outside of the volume this fails.
Specifically, when the query point is in an external voronoi region corresponding to an edge or a vertex of the convex volume, I would like to be able to determine this (so that I can return the edge/vertex as the closest point, rather than the supporting planes)... however I can't see any easy/direct solution for this, without converting to a b-rep.
If anyone has any suggestions, useful links, or even could point out what the correct search terms for this sort of thing are (i.e "implicit convex shape" is probably not the correct jargon for describing a volume formed as the intersection of halfspaces), I would really appreciate it!
thanks,
Raigan
For ray intersection, something that *sort of* works is to calculate the intersection of the ray vs each plane, and then at each intersection check if the intersection point is inside/behind all the other planes. This gives correct results, but seems pretty wasteful/slow; I'm hoping there's a better method someone could suggest.
For distance queries, I'm at even more of a loss: AFAICT all I can calculate from the halfspaces is a bunch of point-to-plane signed distances. For points inside of the convex volume, this works -- the closest point on the surface of the volume is just the point on one of the planes closest to the query point -- but for points outside of the volume this fails.
Specifically, when the query point is in an external voronoi region corresponding to an edge or a vertex of the convex volume, I would like to be able to determine this (so that I can return the edge/vertex as the closest point, rather than the supporting planes)... however I can't see any easy/direct solution for this, without converting to a b-rep.
If anyone has any suggestions, useful links, or even could point out what the correct search terms for this sort of thing are (i.e "implicit convex shape" is probably not the correct jargon for describing a volume formed as the intersection of halfspaces), I would really appreciate it!
thanks,
Raigan