FilledCurve[{segment1,segment2,…}]
表示一条填充曲线,它依次包含 segment1、segment2 等等.
FilledCurve[{component1,component2,…}]
表示由不同的填充分量曲线 component1、component2 等等组成的列表.
FilledCurve
FilledCurve[{segment1,segment2,…}]
表示一条填充曲线,它依次包含 segment1、segment2 等等.
FilledCurve[{component1,component2,…}]
表示由不同的填充分量曲线 component1、component2 等等组成的列表.
更多信息和选项
- FilledCurve 可用于 Graphics(二维图形).
- FilledCurve[segment] 等价于 FilledCurve[{segment}].
- segmenti 的可能形式包括:
-
Line[{pt1,pt2,…}] 线条 BezierCurve[{pt1,pt2,…},…] Bézier 曲线 BSplineCurve[{pt1,pt2,…},…] B-样条曲线 - segmenti 上的第一个点采用 segmenti-1 上的最后一个点. FilledCurve[{pr1[{p1,…,pi}],pr2[{q1,…,qj}],…}] 等价于 FilledCurve[{pr1[{p1,…,pi}],pr2[{pi,q1,…,qj}],…}].
- 填充曲线可以是非凸的,并且与自身相交的. 自相交曲线根据偶-奇原则填充,即交错填充,并且在每个交叉处不填充.
- FilledCurve[{component1,component2,…}] 将每个分量曲线作为一个不同的闭合曲线处理,但是填充行为以同一条曲线的各部分决定.
- 可以使用如下选项指定坐标:
-
{x,y} 普通坐标 Scaled[{x,y}] 尺度缩放后的坐标 ImageScaled[{x,y}] 图像缩放后的坐标 Offset[{dx,dy},{x,y}] 绝对位移坐标 - 线段中的单个坐标和坐标列表可以是 Dynamic 对象.
- FaceForm 和 EdgeForm 可用于指定如何绘制内部和边界.
- 线厚度可以使用 Thickness 或者 AbsoluteThickness,以及 EdgeForm 中的 Thick、Thin 等等指定.
- 虚边可以使用 Dashing 或者 AbsoluteDashing,以及 EdgeForm 中的 Dashed、Dotted 等等指定. 对于FilledCurve,虚线在所有线段上对每个分量曲线上计算.
- 边的着色和透明度可以使用 EdgeForm 中的 CMYKColor、GrayLevel、Hue、Opacity 或者 RGBColor 指定.
- 曲线段的连接可以通过使用 JoinForm 指定.
- 面的着色和透明度可以使用 FaceForm 中的 CMYKColor、GrayLevel、Hue、Opacity 或者 RGBColor 指定.
- 可以使用 Texture 应用纹理,并且使用对曲线指定的 VertexTextureCoordinates 选项映射到曲线.
- Line 的 VertexColors 和 VertexNormals 选项在一个 FilledCurve 结构中不起作用.
范例
打开所有单元 关闭所有单元基本范例 (4)
a = {{-1, 0}, {0, 1}, {1, 0}};Graphics[FilledCurve[{BezierCurve[a]}]]a = {{-1, 0}, {0, 1}, {1, 0}};b = {{0, -(2/3)}, {-1, 0}};Graphics[FilledCurve[{BezierCurve[a], Line[b]}]]pts = {{0, 1}, {-1, -(1/2)}, {1, -(1/2)}};Graphics[FilledCurve[{{Line[2pts]}, {Line[pts]}}]]Graphics[FilledCurve[{{Line[pts]}, {Line[TranslationTransform[{1, (1/2)}][pts]]}}]]a = {{-1, 0}, {0, 1}, {1, 0}};b = {{0, -(2/3)}, {-1, 0}};curve = FilledCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}];{Graphics[{Pink, curve}], Graphics[{EdgeForm[Thick], Pink, curve}], Graphics[{EdgeForm[Directive[Thick, Dashed, Blue]], Pink, curve}]}Graphics[{Texture[ExampleData[{"TestImage", "House"}]], FilledCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}, VertexTextureCoordinates -> {{{0, (1/2)}, {(1/2), 1}, {1, (1/2)}, {(1/2), (1/12)}, {0, (1/2)}}, {{(1/4), (1/2)}, {(1/2), (3/4)}, {(3/4), (1/2)}, {(1/2), (7/24)}, {(1/4), (1/2)}}}]}]范围 (15)
曲线 (9)
说明 (3)
Graphics[{Pink, EdgeForm[Blue], FilledCurve[Line[{{-1, 0}, {-1, 1}, {0, 2}, {1, 1}, {1, 0}}]]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[BezierCurve[{{-1, 0}, {-1, 2}, {1, 2}, {1, 0}}]]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[BSplineCurve[{{-1, 0}, {-1, 1}, {0, 0}, {1, 1}, {1, 0}}]]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[{BSplineCurve[{{-2, 0}, {-1, 1}, {0, -1}, {1, 1}, {2, 0}}], Line[{{2, -1}, {-2, -1}}]}]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[{{-2, 0}, {-2, 2}, {0, 4}, {2, 2}, {2, 0}}]}, {Line[{{-1, 1}, {-1, 2}, {0, 3}, {1, 2}, {1, 1}}]}}]}]pts = {{0, 1}, {-(Sqrt[3]/2), -(1/2)}, {(Sqrt[3]/2), -(1/2)}};Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[4pts]}, {Line[TranslationTransform[{-1, 0}][pts]]}, {Line[TranslationTransform[{1, 0}][pts]]}}]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[3pts]}, {Line[2pts]}, {Line[pts]}}]}]Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[pts]},
{Line[TranslationTransform[{(Sqrt[3]/2), (1/2)}][pts]]}, {Line[TranslationTransform[{Sqrt[3], 1}][pts]]}}]}]样式 (3)
Table[Graphics[{c, FilledCurve[{{BSplineCurve[{{-2, 0}, {-2, 2}, {0, 4}, {2, 2}, {2, 0}}]}, {BSplineCurve[{{-1, 1}, {-1, 2}, {0, 3}, {1, 2}, {1, 1}}]}}]}], {c, {Red, Green, Blue, Yellow}}]FaceForm 和 EdgeForm 可用于指定内部和边界的样式:
Graphics[{FaceForm[Pink], EdgeForm[Directive[Dashed, Thick, Blue]], FilledCurve[{{BSplineCurve[{{-2, 0}, {-2, 2}, {0, 4}, {2, 2}, {2, 0}}]}, {BSplineCurve[{{-1, 1}, {-1, 2}, {0, 3}, {1, 2}, {1, 1}}]}}]}]JoinForm 可用于指定边界连接处的类型:
a = {{-2, 0}, {0, 2}, {2, 0}, {0, -2}};curve = FilledCurve[{{Line[2a]}, {Line[a]}}];{Graphics[{EdgeForm[{JoinForm["Bevel"], Thickness[0.05]}], Pink, curve}, PlotRange -> 5], Graphics[{EdgeForm[{JoinForm["Meter"], Thickness[0.05]}], Pink, curve}, PlotRange -> 5]Graphics[{EdgeForm[{JoinForm["Round"], Thickness[0.05]}], Pink, curve}, PlotRange -> 5]}坐标 (3)
使用 Scaled 坐标:
Graphics[FilledCurve[BezierCurve[{Scaled[{0, 0}], Scaled[{.5, 1}], Scaled[{1, 0}]}]], Frame -> True]使用 ImageScaled 坐标:
Graphics[FilledCurve[BezierCurve[{ImageScaled[{0, 0}], ImageScaled[{.5, 1}], ImageScaled[{1, 0}]}]], Frame -> True]使用 Offset 坐标:
Graphics[FilledCurve[BezierCurve[{Offset[{10, 10}, {0, 0}], Offset[{0, 50}, {.5, 1}], Offset[{-10, 10}, {1, 0}]}]], Frame -> True]区域 (6)
RegionEmbeddingDimension[FilledCurve[{BSplineCurve[{{Subscript[c, 1], Subscript[c, 2]}, {Subscript[c, 3], Subscript[c, 4]}, {Subscript[c, 5], Subscript[c, 6]}}]}]]RegionDimension[FilledCurve[{BSplineCurve[{{Subscript[c, 1], Subscript[c, 2]}, {Subscript[c, 3], Subscript[c, 4]}, {Subscript[c, 5], Subscript[c, 6]}}]}]]{RegionMember[FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}], {0, 0}], RegionMember[FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}], {1, 2}]}ℛ = FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}];{ArcLength[ℛ], RegionMeasure[ℛ]}c = RegionCentroid[ℛ]Graphics[{{Yellow, ℛ}, {Red, Point[c]}}]ℛ = FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}];{RegionDistance[ℛ, {1, 1}], RegionDistance[ℛ, {0, 0}]}{Plot3D[Evaluate@RegionDistance[ℛ, {x, y}], {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3&}, Mesh -> 5, Exclusions -> Norm[{x, y}] == 1], ContourPlot[Evaluate@RegionDistance[ℛ, {x, y}], {x, -3, 4}, {y, -3, 3}, Contours -> {{0.5, Red}, {1, Green}, {1.5, Blue}}]}ℛ = FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}];{SignedRegionDistance[ℛ, {1, 1}], SignedRegionDistance[ℛ, {0, 0}]}Plot3D[SignedRegionDistance[ℛ, {x, y}], {x, -2, 2}, {y, -2, 2}, Exclusions -> Norm[{x, y}] == 1, Mesh -> None]ℛ = FilledCurve[{BSplineCurve[{{0, 0}, {1, 1}, {2, -1}}]}];BoundedRegionQ[ℛ]rr = RegionBounds[ℛ]Graphics[{{EdgeForm[Directive[Dashed, Red]], Opacity[0.1], Yellow, Rectangle@@Transpose[rr]}, ℛ}]推广和延伸 (2)
pts = {{0., -0.5}, {0.5, -0.5}, {0.5, 0.5}, {0., 0.5}, {-0.5, 0.5}, {-0.5, -0.5}, {0., -0.5}};
w = {1, .5, .5, 1, .5, .5, 1};
k = {0, 0, 0, 1 / 4, 1 / 2, 1 / 2, 3 / 4, 1, 1, 1};Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{BSplineCurve[2pts, SplineDegree -> 2, SplineKnots -> k, SplineWeights -> w]}, {BSplineCurve[pts, SplineDegree -> 2, SplineKnots -> k, SplineWeights -> w]}}]}]默认情况下,Bézier 线段在不考虑连接处的切线下进行连接:
Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[{{0, 0}, {2, 2}}], BezierCurve[{{4, 2}, {5, 1}, {6, 0}}]}}]}]Automatic 可用于 Bézier 线段的第一个坐标处,以创建平滑连接:
Graphics[{Pink, EdgeForm[Blue], FilledCurve[{{Line[{{0, 0}, {2, 2}}], BezierCurve[{Automatic, {5, 1}, {6, 0}}]}}]}]选项 (2)
VertexTextureCoordinates (2)
Graphics[{Texture[ExampleData[{"TestImage", "House"}]], FilledCurve[{BezierCurve[{{-1, 0}, {0, 1}, {1, 0}}]}, VertexTextureCoordinates -> {{0, 0}, {1 / 2, 1}, {1, 0}}]}]a = {{-1, 0}, {0, 1}, {1, 0}};b = {{0, -(2/3)}, {-1, 0}};Graphics[{Texture[ExampleData[{"TestImage", "House"}]], FilledCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}, VertexTextureCoordinates -> {{{0, (1/2)}, {(1/2), 1}, {1, (1/2)}, {(1/2), (1/12)}, {0, (1/2)}}, {{(1/4), (1/2)}, {(1/2), (3/4)}, {(3/4), (1/2)}, {(1/2), (7/24)}, {(1/4), (1/2)}}}]}]应用 (5)
图形、图标等 (2)
a = FilledCurve[{{Line[{{2, 3}, {0.8125, 0.625}}],
BezierCurve[{{0.6875, 0.375}, {0.375, 0.25}, {1.125, 0.25}}, SplineDegree -> 2], BezierCurve[{{0.8125, 0.375}, {0.9375, 0.625}}],
Line[{{1.3125, 1.375}, {2.4375, 1.375}, {2.8125, 0.625}}],
BezierCurve[{{2.9375, 0.375}, {2.625, 0.25}, {3.625, 0.25}}, SplineDegree -> 2], BezierCurve[{{3.3125, 0.375}, {3.1875, 0.625}}]},
{Line[{{1.875, 2.5}, {1.375, 1.5}, {2.375, 1.5}}]}}];Graphics[a]Graphics[{EdgeForm[Blue], LightGray, a}]g = First[[image]];Head[g]Graphics[{EdgeForm[Gray],
Table[{Hue[(t/2 π)], Rotate[g, t, {0, 0}]}, {t, 0, 2 π, (π/6)}]}]文本效果 (1)
以填充曲线的方式在图形中导入文本,使用 PDF 作为中间格式:
text = First[First[ImportString[ExportString[Style["Wolfram", Italic, FontSize -> 24, FontFamily -> "Times"], "PDF"], {"PDF", "PageGraphics"}, "TextMode" -> "Outlines"]]];Graphics[{EdgeForm[Black], ColorData["Crayola", "Sunglow"], text}]Graphics[{Gray, Translate[text, {1, -1}], Red, text}]Graphics[{EdgeForm[Opacity[0.5]], Table[{ColorData["TemperatureMap"][t], Translate[text, 4{-t, t}]}, {t, 0, 1, (1/10)}]}, ImageSize -> Medium]文本标题 (1)
text = First[First[ImportString[ExportString[Style["MATHEMATICA", FontSize -> 72, FontFamily -> "Geogia"], "PDF"], {"PDF", "PageGraphics"}, "TextMode" -> "Outlines"]]];Graphics[text, Frame -> True]使用 BSplineFunction 创建包络函数:
top = BSplineFunction[{60, 200, 160}];
middle = BSplineFunction[{45, 150, -30, 45}];bottom = BSplineFunction[{-90, -100, 30}];Plot[{top[t], middle[t], bottom[t]}, {t, 0, 1}]stretch[x_, t_, f_, g_] := Rescale[x, {10, 60}, {f[t], g[t]}]banner1 = text /. {x_Real, y_Real} :> {x, stretch[y, (x/430), bottom, middle]};
banner2 = text /. {x_Real, y_Real} :> {430 - x, stretch[y, 1 - (x/430), middle, top]};Graphics[{EdgeForm[Black], Blue, banner1, Red, banner2}]棋盘形格局 (1)
e1 = {{-(Sqrt[3]/2), -(1/2)}, {-(Sqrt[3]/6), 0}, {(Sqrt[3]/6), -1}, {(Sqrt[3]/2), -(1/2)}};Graphics[BezierCurve[{e1}], Axes -> True]e2 = Map[RotationTransform[120Degree], e1];
e3 = Map[RotationTransform[120Degree], e2];tile = FilledCurve[{BezierCurve[e1], BezierCurve[Rest[e2]], BezierCurve[Rest[e3]]}];Graphics[{EdgeForm[Gray], FaceForm[Opacity[(1/2), Blue]], tile}, Axes -> True, Frame -> True, PlotRange -> 1]Graphics[{EdgeForm[Opacity[(1/4), White]], FaceForm[Red], Table[With[{p = OddQ[i]⊻OddQ[j]} , {If[p, ColorData["HTML", "Crimson"], ColorData["HTML", "DarkBlue"]], Translate[Rotate[tile, (π/3) Boole[p], {0, 0}], {(Sqrt[3] i/2), (3 j/2) + (1/2) Boole[p]}]}], {i, 10}, {j, 4}]}]% /. BezierCurve[a_] :> Line[a]属性和关系 (1)
默认情况下,填充曲线的每个分量通过在顶端添加一个线段使自身闭合:
a = {{-1, 0}, {0, 1}, {1, 0}};b = {{0, -(2/3)}};Graphics[{EdgeForm[Blue], Pink, FilledCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}]}]相反地,默认情况下,JoinedCurve 并不使曲线闭合:
Graphics[JoinedCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}]]使用 CurveClosed 选项使曲线中的分量是闭合的:
Graphics[JoinedCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}}, CurveClosed -> True]]可能存在的问题 (1)
在线段中指定的 VertexColors 选项被忽略:
Graphics[{EdgeForm[Thick], Pink, FilledCurve[Line[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexColors -> {Red, Green, Blue, Yellow}]]}]巧妙范例 (2)
Module[{a = FilledCurve[{{Line[{{2, 3}, {0.8125, 0.625}}],
BezierCurve[{{0.6875, 0.375}, {0.375, 0.25}, {1.125, 0.25}}, SplineDegree -> 2], BezierCurve[{{0.8125, 0.375}, {0.9375, 0.625}}],
Line[{{1.3125, 1.375}, {2.4375, 1.375}, {2.8125, 0.625}}],
BezierCurve[{{2.9375, 0.375}, {2.625, 0.25}, {3.625, 0.25}}, SplineDegree -> 2], BezierCurve[{{3.3125, 0.375}, {3.1875, 0.625}}]},
{Line[{{1.875, 2.5}, {1.375, 1.5}, {2.375, 1.5}}]}}]}, Graphics[Table[{EdgeForm[Black], Hue[RandomReal[]], Translate[Rotate[Scale[a, RandomReal[5]], RandomReal[2Pi]], RandomReal[20, {2}]]}, {30}]]]Module[{l = Cases[First[First[ImportString[ExportString[Style["Mathematica", Bold, FontFamily -> "Helvetica", FontSize -> 12], "PDF"], {"PDF", "PageGraphics"}, "TextOutlines" -> True]]], FilledCurve[a__] :> {EdgeForm[Black], Yellow, FilledCurve[a]}, Infinity]}, Animate[Graphics[{l /. {x_Real, y_Real} :> {x, y + 6 Sin[(x/12) + t]}}], {t, 0, 8 π}, AnimationRunning -> False, SaveDefinitions -> True]]相关指南
-
▪
- 图形对象 ▪
- 组合图形 ▪
- Graphics Primitives Gallery ▪
- 符号图形语言
相关链接
文本
Wolfram Research (2010),FilledCurve,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FilledCurve.html (更新于 2018 年).
CMS
Wolfram 语言. 2010. "FilledCurve." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2018. https://reference.wolfram.com/language/ref/FilledCurve.html.
APA
Wolfram 语言. (2010). FilledCurve. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FilledCurve.html 年
BibTeX
@misc{reference.wolfram_2026_filledcurve, author="Wolfram Research", title="{FilledCurve}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/FilledCurve.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_filledcurve, organization={Wolfram Research}, title={FilledCurve}, year={2018}, url={https://reference.wolfram.com/language/ref/FilledCurve.html}, note=[Accessed: 07-September-2026]}