-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Term Entry - .mesh3d() - Plotly #5617
base: main
Are you sure you want to change the base?
Conversation
@mamtawardhani I have no idea my last commit became the title of the pull request 🤕 This one has beat my head in for sure haha I've fixed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @danitellini thank you for contributing to Codecademy Docs, the entry is nicely written! 😄
I've suggested a few changes, could you please review and modify those at your earliest convenience? Thank you! 😃
- 'paths/data-science-foundations' | ||
--- | ||
|
||
**`.Mesh3d()`** is a method in Plotly's `graph_objects` module that generates 3D mesh plots by defining vertices and connecting faces (triangles). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**`.Mesh3d()`** is a method in Plotly's `graph_objects` module that generates 3D mesh plots by defining vertices and connecting faces (triangles). | |
**`.Mesh3d()`** is a method in Plotly's [`graph_objects`](https://www.codecademy.com/resources/docs/plotly/graph-objects) module that generates 3D mesh plots by defining vertices and connecting them with faces (typically triangles). |
Mesh3d( | ||
x=x_values, | ||
y=y_values, | ||
z=x_values, | ||
i=indices_i, # Optional | ||
j=indices_j, # Optional | ||
k=indices_k, # Optional | ||
color='color_value', # Optional | ||
opacity=opacity_value, # Optional | ||
(...) # Optional | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mesh3d( | |
x=x_values, | |
y=y_values, | |
z=x_values, | |
i=indices_i, # Optional | |
j=indices_j, # Optional | |
k=indices_k, # Optional | |
color='color_value', # Optional | |
opacity=opacity_value, # Optional | |
(...) # Optional | |
) | |
plotly.graph_objects.Mesh3d( x=None, y=None, z=None, i=None, j=None, k=None, color=None, opacity=None, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default values are None
which should be mentioned
- `x`, `y`, `z`: Arrays of vertex coordinates | ||
- `i`, `j`, `k`: Arrays defining the triangles via indices pointing to the vertex arrays | ||
- `color`: Sets the mesh color | ||
- `opacity`: Sets the mesh transparency (0 to 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `x`, `y`, `z`: Arrays of vertex coordinates | |
- `i`, `j`, `k`: Arrays defining the triangles via indices pointing to the vertex arrays | |
- `color`: Sets the mesh color | |
- `opacity`: Sets the mesh transparency (0 to 1) | |
- `x`, `y`, `z`: Coordinates of the vertices in 3D space (arrays or lists). | |
- `i`, `j`, `k`: Indices that define the triangular faces, where each set of three indices corresponds to a triangle formed by the vertices defined by `x`, `y`, and `z`. | |
- `Color`: The color of the mesh, which can be a single color or an array of colors for each face. | |
- `opacity`: Controls the transparency of the mesh, ranging from 0 (fully transparent) to 1 (fully opaque). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reframed and added some details
fig.show() | ||
``` | ||
|
||
> Note: If you don't specify the triangle indices, the mesh will automatically be generated using algorithms like Delaunay triangulation. You can also use the `alphahull` parameter to control the generation without the indices: `alphahull = -1` - Uses Delauney triangulation; `alphahull = 0` - Computes the convex hull of the point set; `alphahull > 0` - Uses the alpha shape algorithm with the specified alpha value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Note: If you don't specify the triangle indices, the mesh will automatically be generated using algorithms like Delaunay triangulation. You can also use the `alphahull` parameter to control the generation without the indices: `alphahull = -1` - Uses Delauney triangulation; `alphahull = 0` - Computes the convex hull of the point set; `alphahull > 0` - Uses the alpha shape algorithm with the specified alpha value. | |
> Note: If triangle indices (`i`, `j`, `k`) are not specified, the mesh will be automatically generated using algorithms like Delaunay triangulation. The `alphahull` parameter can be used to control the mesh generation process without the indices: | |
- `alphahull = -1`: Uses Delaunay triangulation. | |
- `alphahull = 0`: Computes the convex hull of the point set. | |
- `alphahull > 0`: Uses the alpha shape algorithm with the specified alpha value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't usually use you and we
|
||
### Example 2 | ||
|
||
Dataset information can also be used to create the mesh. This visualizes a sphere by using vertex and face data from a CSV file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dataset information can also be used to create the mesh. This visualizes a sphere by using vertex and face data from a CSV file: | |
The dataset information can be used to create a 3D mesh plot, as demonstrated in the example below, which visualizes a sphere using vertex and face data from a CSV file: |
- 'paths/data-science' | ||
- 'paths/data-science-foundations' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 'paths/data-science' | |
- 'paths/data-science-foundations' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us only have 2 paths
Description
Summary of Change:
Topic: Python Plotly
graph_object
.mesh3d()
functionFiles created:
docs/content/plotly/concepts/graph-objects/terms/mesh3d/mesh3d.md
Files added:
docs/media/mesh3d-example-result.png
anddocs/media/mesh3d-dataset-sphere.png
Description: Created a new Term Entry for Python Plotly
graph_object
.mesh3d()
functionOpen issue, and a great way to practice and learn is to teach!
Issue Solved
Closes #5178
Type of Change
Editing an existing entry (fixing a typo, bug, issues, etc)Updating the documentationChecklist
main
branch.Issues Solved
section.