New answers tagged

3

user21 says it isn't guaranteed that the vertices will be in counter-clockwise order, but I can't find a counter-example. Using the method described here we can make a little function that tests a polygon for whether its vertices are CCW ccwQ[list_List] := Positive@Total[Subtract @@@ (list RotateLeft[Reverse /@ list])] ccwQ[poly_Polygon] := ...


2

No, there is no SliceDensityPlot3D for mesh visualization. There is no density to plot. The mesh wireframe is a Graphics/Graphics3D object so you can use sol["ElementMesh"]["Wireframe"[PlotRange -> {All, {40, 60}, All}]] Show[ Graphics3D[{Opacity[0], lrectregion, Opacity[0], rrectregion}, ImageSize -> Large], ...


4

Jason already said a lot of what I wanted to say, so I'll just offer this little snippet that avoids Normal[] chicanery: gc = ExampleData[{"Geometry3D", "StanfordBunny"}, "GraphicsComplex"]; Graphics3D[Insert[gc, EdgeForm[], {2, 1}] /. Polygon[m_?MatrixQ] :> Riffle[Table[RandomColor[], {Length[m]}], Polygon /@ m]] Just for variety, ...


7

There are 69,451 different polygons in the bunny, so that is why it takes so long to plot, so let's use a simpler example with only ~1,400 polygons: MeshVertices[mesh_] := First@Cases[mesh, GraphicsComplex[x_, __] :> x, Infinity] MeshFaces[mesh_] := Block[{faces}, faces = Cases[mesh, Polygon[x_, ___] :> x, Infinity]; If[faces == {}, ...


5

You are almost there. You need to specify a cell measure for the 'background' mesh like so - assuming you want as few elements in not refined regions: ClearAll[mrf]; mrf = Function[{vert, vol}, Block[{y}, y = Min[Abs[vert[[All, 2]]]]; y < 0.2 && vol > 0.005]]; bmesh = ToBoundaryMesh[\[ScriptCapitalR]]; mesh = ToElementMesh[bmesh, ...


2

SphericalPlot3D[se, {tt1, 0, Pi}, {tt2, 0, 2 Pi}, PlotStyle -> Directive[Red, Opacity[1]], PlotPoints -> 30, Boxed -> False, AxesOrigin -> {0, 0, 0}, AxesLabel -> {x, y, z}, TicksStyle -> Directive[FontOpacity -> 0, FontSize -> 0], AxesStyle -> Directive[Black, 12], Lighting -> "Neutral", Mesh -> {Range[-Pi, Pi , 2 ...


2

To get the Plot3D to look the way it used to, use the option PlotTheme -> "Classic". Compare the current output, Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}] with what you get with the classic theme, Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotTheme -> "Classic"] If you want to make that change permanent, then add the line ...



Top 50 recent answers are included