[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-20 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326111#comment-17326111
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

As you wish.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-20 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326106#comment-17326106
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

[~erans], I'd like to close this issue if you don't have any objections. The 
tutorial I just merged doesn't include exactly some of the things we've 
described above but I think we should create new, more focused issues for other 
tutorials, enhancements, etc. that are needed.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-20 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326103#comment-17326103
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

Tutorial added in commit cc0d312bdc1d8225b94d2493167ba55fa41427b5.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-18 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324582#comment-17324582
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

Blah! Those were changes from a previous iteration. I'll put those in a 
different PR.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-18 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324568#comment-17324568
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

Hi [~mattjuntunen].

It seems that PR#150 does more than adding/modifying the tutorial files.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2021-04-18 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324553#comment-17324553
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

New PR is in: https://github.com/apache/commons-geometry/pull/150

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-11-12 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17230614#comment-17230614
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

Here is the branch containing my rough example idea: 
https://github.com/darkma773r/commons-geometry/tree/teapot-tutorial

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-11-12 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17230600#comment-17230600
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

We still do not have a CSG tutorial in the code. I have an outline and a bit of 
code for what I want it to be but we need to implement a few more features 
before it can work the way I want it to. For example, I'd like to use STL 
(GEOMETRY-101)  for the input/output file format since that is a very common 
format for models and especially for 3D printing. That is what I'm working on 
currently, albeit slowly.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-11-12 Thread Arturo Bernal (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17230505#comment-17230505
 ] 

Arturo Bernal commented on GEOMETRY-95:
---

HI [~erans]

 

The PR are merged. Can we close this feature

 

thanks

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-07-04 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17151412#comment-17151412
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

I've added a tutorial for BSP trees in general that will be in beta1. However, 
a full 3D CSG tutorial will wait for another release.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-06-25 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17145035#comment-17145035
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

I added another batch of updates related to 3D models and CSG: 
https://github.com/apache/commons-geometry/pull/80. 

The changes include:
- Expanded IO functionality in examples-io.
- Addition of {{Mesh}} interfaces and one {{SimpleTriangleMesh}} implementation 
class. I initially had this in the examples-io module for use with OBJ files 
but it proved to be very useful so I moved it to commons-geometry-euclidean.
- Addition of {{PartitionedRegionBuilder[23]D}} classes to aid in construction 
of BSP trees with models containing large numbers of facets.
- Addition of {{Planes.extrude()}} methods based on the use case from Sven 
Rathgeber mentioned in the dev mailing list.

Feedback is welcome.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-06-01 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120984#comment-17120984
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

OK.  Thanks for the explanations.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-06-01 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120964#comment-17120964
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

bq. Interesting. Could you expand on that? Or is it in the documentation?

It's better for BSP trees because it is more uniform. With UV-spheres the 
boundaries near the equator are large while the one near the poles can get 
incredibly small. This means that during construction of the tree, the regions 
at the poles are subject to floating point precision issues much earlier than 
the ones at the equator. This limits the overall number of facets that can be 
produced. The icosphere version does not have this issue because all of the 
boundary triangles have the same size. This uniformity also makes it much 
easier to produce balanced trees, which equals better performance.

bq. Do you mean that it would it be relatively easy to implement a general 
algorithm to implement all the 3D shapes described by the two numbers defined 
here?

No. The logic for building the UV-sphere was very complicated because it needed 
to create different types of boundary shapes (triangles at the poles and quads 
everywhere else) while trying to insert internal cuts in the tree to keep it 
balanced. The icosphere version is just a simple recursive algorithm.

bq. Wouldn't it be better to keep the alternatives (e.g. if just to compare 
their relative merits, depending on user needs)?

Not in this case, IMHO. UV-spheres may be useful for meshes and texture mapping 
but they are not good when it comes to BSP trees. The only case where I can 
imagine that someone would need a UV-sphere BSP tree would be if they 
immediately wanted to extract the boundaries from the tree and use them in a 
mesh or something, in which case constructing the intermediate BSP tree is 
simply a waste of time. I would rather keep the API simple and just provide the 
best, most robust, and most performant algorithm in the {{Sphere}} class.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-06-01 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120865#comment-17120865
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

{quote}"icosphere" [...] relates to BSP trees.
{quote}
Interesting. Could you expand on that? Or is it in the documentation?
{quote}The code is much simpler.
{quote}
I didn't expect that. Do you mean that it would it be relatively easy to 
implement a general algorithm to implement all the 3D shapes described by the 
two numbers defined [here|https://en.wikipedia.org/wiki/Schl%C3%A4fli_symbol]?

bq. UV-spheres [...] removed

Wouldn't it be better to keep the alternatives (e.g. if just to compare their 
relative merits, depending on user needs)?


> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120702#comment-17120702
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

bq. Did you remove the "uv-sphere" implementation?

Yes. The "icosphere" implementation is much better as it relates to BSP trees. 
Here are some benefits:
- It produces boundary triangles of equal size.
- The code is much simpler.
- It can produce much more detailed sphere approximations.

UV-spheres have many uses but I would highly encourage users to use the 
"icosphere" implementation for BSP trees. Therefore, I removed the old 
implementation.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120633#comment-17120633
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

bq. "icosphere"

Did you remove the "uv-sphere" implementation?

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-31 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17120577#comment-17120577
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

I just added a PR containing the update {{Sphere.toTree}} approach: 
https://github.com/apache/commons-geometry/pull/78 (ie, "icosphere"). This 
uncovered a number of numerical robustness issues that I then addressed. We now 
have a unit test that creates a sphere approximation with over 500,000 boundary 
triangles.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-26 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116730#comment-17116730
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

bq. Information such as per-facet attributes is lost when facets are inserted 
into a BSP tree since the facets are manipulated (split and/or expanded) during 
insertion. [...]

I don't doubt that the per-facet attributes feature is an afterthought, not 
easily included in the design.
For sure, many applications would need a way to recover original attributes.  
This is the case in the use-case which I outlined: The projected facets provide 
the area by which the original quantity (e.g. "luminosity") is weighted.

bq. If the end goal is to render a 3D scene, [...] I would [...] use the 
linecasting functionality to create a ray-tracing implementation. 

Maybe, but the issue is the performance; the expectation was that projection 
would have been (much?) faster.
In my case, the "rendering" must be done for ~5000 facets (or more) for each of 
~70 data points in a time series, driven by an optimizer trying to fit the 
parameters that describe the scene.  In addition, _some_ of the facets "know" 
(by another means) whether they are visible or not; this alternative algorithm 
would be expected to provide more precise values for facets that are only 
_partially_ visible...

bq. 1. Load a 3D model from a file, perform some transformations and [...]

Sure, a necessary step to allow experimenting.

bq. 2. Demonstrate the linecasting functionality [...] would be little more 
than a fun toy implementation [...]

Then, I'd suggest to not spend time on this track.
Better improve the usability of the first track, with an eye towards preparing 
suitable input files for full-featured rendering engines (with examples 
generated by those softwares).


> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-26 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116693#comment-17116693
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

bq. That would be a necessary feature in many cases.
For example, I seem to recall that you mentioned the like of facet objects that 
would also carry additional (user-provided) information. If this information is 
"color", it is needed in order to draw scene as would be seen from the 
specified viewpoint.

Information such as per-facet attributes is lost when facets are inserted into 
a BSP tree since the facets are manipulated (split and/or expanded) during 
insertion. If the end goal is to render a 3D scene, this is not the approach I 
would take. I would instead use the linecasting functionality to create a 
ray-tracing implementation. This would not involve projection onto a 2D plane.

So, this leads me back to the original question: is there a specific use case 
you'd like to show in the examples? Two use cases that I can picture as useful 
are :
1. Load a 3D model from a file, perform some transformations and/or boolean 
operations on it and then write it back out as a file. This would be very 
useful to see since, as far as I am aware, this is the only Java library that 
can perform these CSG-type boolean operations on arbitrary regions. (This is 
the original use case that led me to start working on the geometry code in 
commons-math.)
2. Demonstrate the linecasting functionality by creating a simple ray-tracer 
capable of rendering images of simple 3D scenes (containing geometric shapes 
only; no textures, etc). This would be little more than a fun toy 
implementation since there are much better libraries and techniques for 
software rendering, but it would still be instructive and might produce some 
cool-looking images we could use in the site.

WDYT?

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-25 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116131#comment-17116131
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

bq. [...] object B, project it onto a plane orthogonal to your look direction, 
and then subtract the projection of object A onto that same plane [...]

Yes, that was what I had in mind.

bq. would not be able to provide visible point coordinates

That would be a necessary feature in many cases.
For example, I seem to recall that you mentioned the like of facet objects that 
would also carry additional (user-provided) information.  If this information 
is "color", it is needed in order to draw scene as would be seen from the 
specified viewpoint.


> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-25 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116105#comment-17116105
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

I'm just trying to get a sense of what you have in mind for visibility 
determination since there are many ways to do that. One way (which is one that 
we've done at my day job), is to take a number of rays from certain vantage 
points and cast them against the objects in the scene. If the ray intersection 
with object {{A}} is closer than the ray intersection for object {{B}}, then 
object {{B}} is occluded by {{A}} at that point. This is effective and quick 
but it does not give a completely full picture of the situation since only a 
finite number of rays can be cast. It is possible that the object visibility is 
not what is expected at one of the points that was not tested. However, this 
approach can also given you valuable information about the visible point, such 
as the point coordinates and normal.

Another option is to take the objects being tested, project them onto a 2D 
plane (see GEOMETRY-67), and compute the difference of the regions. In this 
case, you would take object {{B}}, project it onto a plane orthogonal to your 
look direction, and then subtract the projection of object {{A}} onto that same 
plane. If the resulting 2D region is not empty, then some portion of {{B}} is 
not occluded by {{A}}. This provides a completely full picture of the 
visibility (using an orthographic projection) but would not be able to provide 
visible point coordinates or surface normals. 

Which of the above approaches is best depends on a number of factors, such how 
much accuracy is required, how complex the models in question are, whether 
surface normals are needed, whether or not the models must be transformed 
before comparison, etc. That's why I was asking for more details on your 
particular use case.

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-25 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116035#comment-17116035
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

{quote}1. Create a Ray from some eye location and look direction.
 2. Cast it against 2 or more created regions.
 3. See which one intersects first.
{quote}
Do you mean
 # create a "look direction" from the "vantage" point to a "facet" of the 
farther region,
 # cast it onto the closer region, and get "infinity" if there is no 
intersection?

Does the developer need to do it for every "facet" of the farther region?


> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-05-25 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17116009#comment-17116009
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

bq. compute the set of visible elements from some vantage point.

Can you explain more about your intended use case here? I'm wondering if the 
linecast functionality is sufficient here. A simple case using linecasting 
would be 
1. Create a {{Ray}} from some eye location and look direction.
2. Cast it against 2 or more created regions.
3. See which one intersects first.

Are you picturing anything more than that?

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-04-20 Thread Gilles Sadowski (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087650#comment-17087650
 ] 

Gilles Sadowski commented on GEOMETRY-95:
-

Thanks for taking care of that. :-)

Also adding link to the related 
[icosphere|https://blender.stackexchange.com/questions/72/what-is-the-difference-between-a-uv-sphere-and-an-icosphere]
 feature request mentioned in that [ML 
thread|https://markmail.org/message/ahqklekbsxk7j4os].

bq. Example

Beyond describing the above steps in code, it could also be the opportunity for 
another "story", that is explaining, from bottom up (unlike the Javadoc), which 
classes one can use in order to achieve a given task, and along the way, how 
each perhaps provides additional functionalities (and perhaps represent a more 
general concept) that hint at further uses (that don't have to be explained in 
the flow of that particular example).


> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>  Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEOMETRY-95) CSG Examples

2020-04-20 Thread Matt Juntunen (Jira)


[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17087617#comment-17087617
 ] 

Matt Juntunen commented on GEOMETRY-95:
---

Example requested by [~erans] (on the dev mailing list):

 - create a sphere (icosphere if possible),
 - access its mesh ("Triangle3D" ?),
 - apply a transform (possibly non-affine) to the set of vertices,
 - recreate a BSP tree representation of the resulting mesh (?),
 - do the above for a second shape,
 - compute the set of visible elements from some vantage point.

 

> CSG Examples
> 
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
>  Issue Type: New Feature
>Reporter: Matt Juntunen
>Priority: Major
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)