Message Boards Message Boards

0
|
2957 Views
|
6 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Best way to produce interactive 3d images of tangles/knots?

Posted 4 years ago

On my html5 website on physics, I would like to add 3d computer graphics of tangles. (Tangles are cousins of knots.) The tangles would be similar to the one in the following photograph. I would like to allow users to rotate the image of such a tangle and thus allow them to view the tangle from all sides.

Question1 : How can I generate such a tangle most easily in Mathematica?

Question 2: What is the best 3d format to export it, and what is the best/easiest way to embed the 3d image in a html5 page, so that viewers can rotate the image with their mouse or with sliders?

(P.S. Tubular ropes are completely sufficient, without any substructure. P.P.S. Apart from Mathematica, I also own KnotPlot.)

A tangle photograph

POSTED BY: Chris S
6 Replies
Posted 4 years ago

Hi Chris,

For knots you can use KnotData. e.g. for an interactive 3D image

KnotData[{"TorusKnot", {3, 5}}, "Image"]

One way to customize the appearance is to get the functional form and plot it

f = KnotData[{"TorusKnot", {3, 5}}, "SpaceCurve"];
ParametricPlot3D[f[t], {t, 0, 2 Pi},
  ViewPoint -> {Pi/2, Pi/2, 2},
  Axes -> False,
  Boxed -> False,
  ColorFunction -> "Rainbow",
  PlotRange -> All] /. Line[pts_, rest___] :> Tube[pts, 0.2, rest]

enter image description here

Not sure how to add an interactive version to your website. Maybe you can use one of the supported 3D export formats.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

I am not aware of any pre-defined tangles in Mathematica, perhaps someone else knows.

For embedding the export into a web page, check this post on MSE. Nice interactive example linked from that post.

POSTED BY: Updating Name
Posted 4 years ago

Chris,

In case you are wondering, "Updating Name" was me. It is a longstanding bug on this site.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

Thank you - are there also pre-defined tangles in Mathematica?

POSTED BY: Chris S
Posted 4 years ago

And another question: which of the several dozen predefined 3d formats is the best to add it into html?

POSTED BY: Chris S
Posted 4 years ago

Rohit,

thank you, that is an excellent answer. Very helpful.

Now, I just have to learn how to create tangle images.

POSTED BY: Chris S
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract