Tag Info

Hot answers tagged

7

Because when in Europe... Monte-Carlo! This should work with any shaped tube as long you are given the center points, and a certain resolution, in your case, should be the size of the polygon that make up the surface, or for example the minimum distance between point along the surface. Let's say that distance is dis. First we make a path along the inside ...


4

This is in theory pretty simple. Think of it as two separated steps. First, you need function that models your extrusion-thickness, which has in the middle always the same value and at both ends it should round up like a circle. You can do this with Piecewise or, as I show here, with a combination of Heaviside functions: thicknessFunc[z_, body_] := ...


3

Here, I'll give an approximate solution also based on the Monte-Carlo approach but using very convenient functions introduced in V10. Here it is: pts = Import["https://dl.dropboxusercontent.com/u/68983831/npts.txt", "Table"]; polys = Import["https://dl.dropboxusercontent.com/u/68983831/npolys.txt", "Table"]; cpts = ...


3

This might be a bit naive but if you are approximating a cylinder, why wouldn't you simply do the following? pts = Import["https://dl.dropboxusercontent.com/u/68983831/npts.txt", "Table"]; cpts = Import["https://dl.dropboxusercontent.com/u/68983831/cpts.txt", "Table"]; polys = Import["https://dl.dropboxusercontent.com/u/68983831/npolys.txt", "Table"]; fpts ...


2

In Version 10, we can compute the convex hull using ConvexHullMesh p = {{2, 1, 6}, {4, 3, 0}, {5, 2, 5}, {3, 5, 4}} chull = ConvexHullMesh[p] Which we can style using HighlightMesh Show[HighlightMesh[chull, Labeled[1, "Index"]], Graphics3D[{Red, Sphere[p, 0.1]}]]


1

How about this. Generate a list of 2D points: pts = Table[{Cos[2 \[Pi] k/6], Sin[2 \[Pi] k/6]}, {k, 0, 6}]; ListLinePlot[pts] and we'll use a scaling function to form the caps. Plot[Sqrt[1 - (Abs@z - 1)^2], {z, -1, 1}, AspectRatio -> 1] sfunc[pt_] := Module[{z = Last@pt}, Piecewise[{{pt, -1 < Last@pt < 1}}, {{Sqrt[1 - (Abs@z - 1)^2], ...



Only top voted, non community-wiki answers of a minimum length are eligible