1
$\begingroup$

Consider the following two Graphics3D objects that can individually be meshed using DiscretizeGraphics. The first is a cone (produced via ParametricPlot3D):

centre = {-0.7187445069014783`, 0.9892669447371633`, 
   0.17750547233320435`};
tip = {0, 0, 0};
vec1 = {-0.6163296489428813`, 1.088347326141306`, 
   0.04000644601351258`};
vec2 = {-0.8446234808586002`, 0.9224821483732286`, 
   0.04000644601351257`};
{v1, v2, v3} = # & /@ HodgeDual[centre - tip];
e1 = Normalize[v1];
e3 = Normalize[centre - tip];
e2 = Cross[e1, e3];

coneBounded = 
 ParametricPlot3D[
  s*tip + (1 - s)*(centre + Rc*(Cos[t]*e1 + Sin[t]*e2)), {t, 0, 
   2 \[Pi]}, {s, 0, 1}, Boxed -> False, Axes -> False, Mesh -> None, 
  RegionFunction -> 
   Function[{x, y, z}, 
    RegionMember[
     HalfSpace[Cross[vec1 - tip, vec2 - tip], tip], {x, y, z}]],
  PlotStyle -> ColorData["Rainbow"][1]];
DiscretizeGraphics[%];
{%%, %}

gives:

enter image description here

The second is a pair of triangles that bounds the cone:

t1={{0.0735871, 0.0450942, 0.0800129}, {0., 0., 0.}, {-0.61633, 1.08835, 
  0.0400064}};
t2={{0., 0., 0.}, {-0.0656268, -0.0560506, 
  0.0800129}, {-0.844623, 0.922482, 0.0400064}};
conetriangle = Graphics3D[{Blue, Triangle[t1], Triangle[t2]}]
DiscretizeGraphics[%];
DiscretizeRegion[%,  MaxCellMeasure -> {"Area" -> 0.01}];
{%%%, %}

giving:

enter image description here

Note: The further use of DiscretizeRegion is required to counteract a bug reported here: Change mesh density of Graphics3D object made of Triangles

I can also try and combine one cone and two adjoining triangles (using Show), and the result is as expected (the discretisation considers the combined object as a piecewise union and thus discretises separately):

Show[coneBounded, conetriangle] ;
DiscretizeGraphics[%];
DiscretizeRegion[%, MaxCellMeasure -> {"Area" -> 0.01}];
{%%%, %}

giving:

enter image description here

PROBLEM 1:

How do I get such a combined Graphics3D object to mesh with a uniform MaxCellMeasure everywhere? Thus, in the above picture, the cone and triangles would have roughly the same cell size.


PROBLEM 2:

Another problem arises when I try to combine many such cones and triangles together (using a combination of Table with rotations, and then Show), and then use DiscretizeGraphics on the whole. Here, I only get the triangles back!

fullSolution;
DiscretizeGraphics[%];
{%%, %}
(*where do the cones go?*)

gives:

enter image description here

I have no idea what is going on. Any help would be appreciated.

$\endgroup$
3
  • $\begingroup$ Can you share the code for coneBounded and conetriangle? $\endgroup$ – user21 Feb 16 at 4:43
  • $\begingroup$ @user21 Done. Sorry for that. $\endgroup$ – ap21 Feb 16 at 13:05
  • $\begingroup$ When I run your code, it still misses definitions. Anyways. have a look at the OpenCascadeLink. You might be able to do it with that. $\endgroup$ – user21 Feb 17 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.