1
$\begingroup$

Let

    cantor2 = CantorMesh[2]

As expected:

    RegionBounds[cantor2]
(* {{0., 1.}} *)

And as expected:

    Flatten@Rationalize@MeshCoordinates[cantor2]
(* {0, 1/9, 2/9, 1/3, 2/3, 7/9, 8/9, 1} *) 

Then what is the meaning of the output below?

    MeshCells[cantor2, RegionDimension[cantor2]]
(* {Line[{1, 2}], Line[{3, 4}], Line[{5, 6}], Line[{7, 8}]} *) 

I expected it to be a list of lines with endpoints the various rational numbers in the interval from 0 to 1.

$\endgroup$
3
  • 3
    $\begingroup$ You want MeshPrimitives[]: MeshPrimitives[CantorMesh[2], 1] // Rationalize. See the second bullet point under "Details" in the MeshCells[] doc page. $\endgroup$ Jun 4 at 21:40
  • $\begingroup$ @J.M.: OK, that gives what I want. But what then does MeshCells[CantorMesh[2], RegionDimension[CantorMesh[2]]] mean? $\endgroup$
    – murray
    Jun 4 at 21:45
  • 2
    $\begingroup$ The integers are indices into the MeshCoordinates[] similar to GraphicsComplex[]. $\endgroup$
    – Michael E2
    Jun 4 at 21:57

0

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.