From 532f728a88b86829474edc5f9f648b0d85607289 Mon Sep 17 00:00:00 2001 From: Abzal Serikbay Date: Mon, 26 Oct 2026 13:37:31 +0500 Subject: [PATCH] [vector_math] Document RingGenerator API --- packages/vector_math/CHANGELOG.md | 4 ++++ .../generators/ring_generator.dart | 19 +++++++++++++++---- packages/vector_math/pubspec.yaml | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/vector_math/CHANGELOG.md b/packages/vector_math/CHANGELOG.md index 4ba08dc6..154cca35 100644 --- a/packages/vector_math/CHANGELOG.md +++ b/packages/vector_math/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.4 + +* Documents the public `RingGenerator` API. + ## 2.4.3 * Documents the public `CircleGenerator` API. diff --git a/packages/vector_math/lib/src/vector_math_geometry/generators/ring_generator.dart b/packages/vector_math/lib/src/vector_math_geometry/generators/ring_generator.dart index a8892ac0..671ff4a7 100644 --- a/packages/vector_math/lib/src/vector_math_geometry/generators/ring_generator.dart +++ b/packages/vector_math/lib/src/vector_math_geometry/generators/ring_generator.dart @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(stuartmorgan): Remove this and fix violations. See -// https://github.com/flutter/flutter/issues/186827 -// ignore_for_file: public_member_api_docs - part of '../../../vector_math_geometry.dart'; +/// Generates a flat ring (annulus) or partial-ring mesh in the XZ plane, +/// centered at the origin. class RingGenerator extends GeometryGenerator { late double _innerRadius; late double _outerRadius; @@ -22,6 +20,19 @@ class RingGenerator extends GeometryGenerator { @override int get indexCount => _segments * 3 * 2; + /// Creates a ring mesh between [innerRadius] and [outerRadius]. + /// + /// The [segments] parameter controls how many quads are used around the + /// ring. The [thetaStart] and [thetaLength] parameters can be used to + /// generate only an arc of the ring, both given in radians. + /// + /// If [stripTextureCoordinates] is true, texture coordinates are mapped as + /// a strip: u goes from 0.0 on the inner edge to 1.0 on the outer edge, and + /// v goes from 0.0 to 1.0 along the ring. Otherwise, the vertex positions + /// are projected onto the texture from above. + /// + /// The [flags] parameter configures which vertex attributes to generate, and + /// [filters] specifies any mesh transformations to apply after generation. MeshGeometry createRing( double innerRadius, double outerRadius, { diff --git a/packages/vector_math/pubspec.yaml b/packages/vector_math/pubspec.yaml index fa38b2ed..21624bc1 100644 --- a/packages/vector_math/pubspec.yaml +++ b/packages/vector_math/pubspec.yaml @@ -5,7 +5,7 @@ name: vector_math description: A vector math library for 2D and 3D applications, supporting 2D, 3D, and 4D matrices. repository: https://github.com/flutter/core-packages/tree/main/packages/vector_math issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+vector_math%22 -version: 2.4.3 +version: 2.4.4 environment: sdk: ^3.10.0