0
$\begingroup$

I need to construct a triangular patch by using the 6 control points:

$$\begin{array}{ccc} \left(\frac{1}{2},\frac{\sqrt{3}}{4},1\right) & \left(\frac{1}{4},\frac{\sqrt{3}}{4},2\right) & \left(\frac{3}{4},\frac{\sqrt{3}}{4},2\right) \\ (0,0,1) & \left(\frac{1}{2},0,2\right) & (1,0,1) \\ \end{array}$$

However, the surface seems not like a triangular patch. Can anyone help me to solve the problem?

Here is the code:

pts = 
  {{{1/2, Sqrt[3]/2, 1}, {0, 0, 1}},
   {{1/4, Sqrt[3]/4, 2}, {1/2, 0, 2}},
   {{3/4, Sqrt[3]/4, 2}, {1, 0, 1}}};
f = BezierFunction[pts]

Show[
  Graphics3D[{PointSize[Medium], Red, Map[Point, pts]}], 
  Graphics3D[{Gray, Line[pts], Line[Transpose[pts]]}], 
  ParametricPlot3D[f[u, v], {u, 0, 1}, {v, 0, 1}, 
    ColorFunction -> "Rainbow"],
    Mesh -> Full,
    Axes -> True, 
    AxesLabel -> {"x", "y", "z"}]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ See: mathematica.stackexchange.com/questions/235541/… $\endgroup$ Commented Nov 29, 2020 at 13:42
  • $\begingroup$ There’s a mismatch for the first control point in the list and your code. The code is Sqrt[3]/2. Did you mean Sqrt[3]/4 in both places? $\endgroup$
    – creidhne
    Commented Nov 29, 2020 at 14:56
  • $\begingroup$ When you include code in your questions, please check that you can copy from the question and paste into Mathematica without errors. It’s better for people who can help if they can easily copy and paste. $\endgroup$
    – creidhne
    Commented Nov 29, 2020 at 15:01

0

Browse other questions tagged or ask your own question.