---
Product: Aspose.3D
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/3d/java/Rect
---

# Rect

## Overview

`Rect` is a class in Aspose.3D FOSS for Java.
Inherits from: `Struct`, `Serializable`.

A class to represent the rectangle
 /

This class provides 19 methods for working with Rect objects in Java programs.
Available methods include: `Rect`, `clone`, `contains`, `copyFrom`, `equals`, `getBottom`, `getHeight`, `getLeft`, `getRight`, `getTop`, `getWidth`, `getX`, and 6 additional methods.
All public members are accessible to any Java application after installing the Aspose.3D FOSS for Java package.
Properties: `bottom`, `height`, `left`, `right`, `top`, `width`, and 2 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `x` | `int` | Read | Gets the x of the size
 @return the x of the size
 / |
| `y` | `int` | Read | Gets the y of the size
 @return the y of the size
 / |
| `width` | `int` | Read | Gets the width of the size
 @return the width of the size
 / |
| `height` | `int` | Read | Gets the height of the size
 @return the height of the size
 / |
| `left` | `int` | Read | Gets the left of the rectangle
 @return the left of the rectangle
 / |
| `right` | `int` | Read | Gets the right of the rectangle
 @return the right of the rectangle
 / |
| `top` | `int` | Read | Gets the top of the rectangle
 @return the top of the rectangle
 / |
| `bottom` | `int` | Read | Gets the bottom of the rectangle
 @return the bottom of the rectangle
 / |

## Methods

| Signature | Description |
|-----------|-------------|
| `Rect()` | Calls Rect on this Rect instance. |
| `Rect(x: int, y: int, width: int, height: int)` | Calls Rect(x, y, width, height) on this Rect instance. |
| `getX()` → `int` | Gets the x of the size
 @return the x of the size
 / |
| `setX(value: int)` | Sets the x of the size
 @param value New value
 / |
| `getY()` → `int` | Gets the y of the size
 @return the y of the size
 / |
| `setY(value: int)` | Sets the y of the size
 @param value New value
 / |
| `getWidth()` → `int` | Gets the width of the size
 @return the width of the size
 / |
| `setWidth(value: int)` | Sets the width of the size
 @param value New value
 / |
| `getHeight()` → `int` | Gets the height of the size
 @return the height of the size
 / |
| `setHeight(value: int)` | Sets the height of the size
 @param value New value
 / |
| `getLeft()` → `int` | Gets the left of the rectangle
 @return the left of the rectangle
 / |
| `getRight()` → `int` | Gets the right of the rectangle
 @return the right of the rectangle
 / |
| `getTop()` → `int` | Gets the top of the rectangle
 @return the top of the rectangle
 / |
| `getBottom()` → `int` | Gets the bottom of the rectangle
 @return the bottom of the rectangle
 / |
| `contains(x: int, y: int)` → `boolean` | Return true if the given point is inside the rectangle. |
| `clone()` → `Rect` | Clone current instance
 @return cloned instance
 / |
| `copyFrom(src: Rect)` | Description copied from interface: Struct
 @param src source instance to copy
 / |
| `hashCode()` → `int` | Calls hashCode on this Rect instance. |
| `equals(obj: Object)` → `boolean` | Calls equals(obj) on this Rect instance. |

## See Also

- [Aspose.3D — Enterprise API Reference](https://reference.aspose.com/3d/)