In computer graphics, the Cyrus–Beck algorithm is a generalized algorithm for line clipping. It was designed to be more efficient than the Cohen–Sutherland algorithm, which uses repetitive clipping. Cyrus–Beck is a general algorithm and can be used with a convex polygon clipping window, unlike Cohen-Sutherland, which can be used only on a rectangular clipping area. Here the parametric equation of a line in the view plane is where . Now to find the intersection point with the clipping window, we calculate the value of the dot product. Let be a point on the clipping plane . Calculate :
Attributes | Values |
---|
rdf:type
| |
rdfs:label
| - Cyrus–Beck algorithm (en)
- Algoritmo de Cyrus-Beck (es)
- Алгоритм Кируса — Бека (ru)
- Алгоритм Кіруса — Бека (uk)
|
rdfs:comment
| - Алгоритм Кируса — Бека (англ. Cyrus — Beck) — алгоритм отсечения отрезков произвольным выпуклым многоугольником.Был предложен в качестве более эффективной замены алгоритма Коэна — Сазерленда, который выполняет отсечение за несколько итераций. (ru)
- Алгоритм Кіруса — Бека (англ. Cyrus — Beck) — алгоритм відсікання відрізків довільним опуклим багатокутником. Був запропонований як ефективніша заміна алгоритму Коена — Сазерленда, який виконує відсікання за кілька ітерацій. (uk)
- In computer graphics, the Cyrus–Beck algorithm is a generalized algorithm for line clipping. It was designed to be more efficient than the Cohen–Sutherland algorithm, which uses repetitive clipping. Cyrus–Beck is a general algorithm and can be used with a convex polygon clipping window, unlike Cohen-Sutherland, which can be used only on a rectangular clipping area. Here the parametric equation of a line in the view plane is where . Now to find the intersection point with the clipping window, we calculate the value of the dot product. Let be a point on the clipping plane . Calculate : (en)
- El algoritmo de Cyrus-Beck es un algoritmo de recorte de líneas y polígonos convexos. De forma similar al algoritmo de Cohen-Sutherland también utiliza aristas extendidas. Se puede adaptar muy fácilmente entre rayos y polígonos convexos o segmentos y polígonos convexos. Implementación del algoritmo de Cyrus-Beck en C# (es)
|
foaf:depiction
| |
dcterms:subject
| |
Wikipage page ID
| |
Wikipage revision ID
| |
Link from a Wikipage to another Wikipage
| |
Link from a Wikipage to an external page
| |
sameAs
| |
dbp:wikiPageUsesTemplate
| |
thumbnail
| |
has abstract
| - In computer graphics, the Cyrus–Beck algorithm is a generalized algorithm for line clipping. It was designed to be more efficient than the Cohen–Sutherland algorithm, which uses repetitive clipping. Cyrus–Beck is a general algorithm and can be used with a convex polygon clipping window, unlike Cohen-Sutherland, which can be used only on a rectangular clipping area. Here the parametric equation of a line in the view plane is where . Now to find the intersection point with the clipping window, we calculate the value of the dot product. Let be a point on the clipping plane . Calculate :
* if < 0, vector pointed towards interior;
* if = 0, vector pointed parallel to plane containing ;
* if > 0, vector pointed away from interior. Here stands for normal of the current clipping plane (pointed away from interior). By this we select the point of intersection of line and clipping window where (dot product is 0) and hence clip the line. (en)
- El algoritmo de Cyrus-Beck es un algoritmo de recorte de líneas y polígonos convexos. De forma similar al algoritmo de Cohen-Sutherland también utiliza aristas extendidas. Se puede adaptar muy fácilmente entre rayos y polígonos convexos o segmentos y polígonos convexos. Implementación del algoritmo de Cyrus-Beck en C# internal sealed class CyrusBeckClipping : IClippingAlgorithm { private List<Vector2> _clipArea = new List<Vector2>; private List<Vector2> _normals = new List<Vector2>; public IEnumerable<Vector2> GetBoundingPolygon { return _clipArea; } public void SetBoundingRectangle(Vector2 start, Vector2 end) { _clipArea.Clear; _clipArea.Add(start); _clipArea.Add(new Vector2(end.X, start.Y)); _clipArea.Add(end); _clipArea.Add(new Vector2(start.X, end.Y)); computeNormals; } public void SetBoundingPolygon(IEnumerable<Vector2> points) { _clipArea.Clear; _clipArea.AddRange(points); computeNormals; } private void computeNormals { _normals.Clear; for (int i = 0; i < _clipArea.Count - 1; i++) { Vector2 direction = _clipArea[i + 1] - _clipArea[i]; direction.Normalize; _normals.Add(new Vector2(-direction.Y, direction.X)); } { Vector2 direction = _clipArea[0] - _clipArea[_clipArea.Count - 1]; direction.Normalize; _normals.Add(new Vector2(-direction.Y, direction.X)); } } public bool ClipLine(ref Line line) { Vector2 P = line.End - line.Start; float tMinimum = 0, tMaximum = 1; const float epsilon = 0.0001f; for (int i = 0; i < _clipArea.Count; i++) { Vector2 F = _clipArea[i]; Vector2 N = _normals[i]; Vector2 Q = line.Start - F; float Pn = Vector2.DotProduct(P, N); float Qn = Vector2.DotProduct(Q, N); if (Pn < epsilon && Pn > -epsilon) { if (Qn < 0) return false; } else { float computedT = -Qn / Pn; if (Pn < 0) { if (computedT < tMinimum) return false; if (computedT < tMaximum) tMaximum = computedT; } else { if (computedT > tMaximum) return false; if (computedT > tMinimum) tMinimum = computedT; } } } if (tMinimum < tMaximum) { if (tMaximum < 1) line.End = line.Start + tMaximum * P; if (tMinimum > 0) line.Start = line.Start + tMinimum * P; } else return false; return true; } public ClippingCapabilities Capabilities { get { return ClippingCapabilities.ConvexWindow | ClippingCapabilities.RectangleWindow; } } public override string ToString { return "Cyrus-Beck algorithm"; }}// This code was implemented by Grishul Eugeny as part of preparation// to exam in ITMO university
* Datos: Q5201169 (es)
- Алгоритм Кируса — Бека (англ. Cyrus — Beck) — алгоритм отсечения отрезков произвольным выпуклым многоугольником.Был предложен в качестве более эффективной замены алгоритма Коэна — Сазерленда, который выполняет отсечение за несколько итераций. (ru)
- Алгоритм Кіруса — Бека (англ. Cyrus — Beck) — алгоритм відсікання відрізків довільним опуклим багатокутником. Був запропонований як ефективніша заміна алгоритму Коена — Сазерленда, який виконує відсікання за кілька ітерацій. (uk)
|
prov:wasDerivedFrom
| |
page length (characters) of wiki page
| |
foaf:isPrimaryTopicOf
| |
is Link from a Wikipage to another Wikipage
of | |
is Wikipage redirect
of | |
is Wikipage disambiguates
of | |
is foaf:primaryTopic
of | |