Comments (5)
Do you have an image of what you are trying to achieve? gr3.createsurfacemesh
would used be for creating a surface plot. A "rectangular grid of lines" sounds more like something built from cylinders (and possibly spheres for the corners) like this:
import gr3
import numpy as np
n_per_axis = 11
n = 2*n_per_axis
positions = np.zeros((n, 3))
positions[:n_per_axis, 0] = np.linspace(-2, 2, n_per_axis)
positions[:n_per_axis, 1] = -2
positions[n_per_axis:, 0] = -2
positions[n_per_axis:, 1] = np.linspace(-2, 2, n_per_axis)
directions = np.zeros((22, 3))
directions[:n_per_axis, 1] = 1
directions[n_per_axis:, 0] = 1
colors = np.ones((22, 3))
radii = 0.01 * np.ones(22)
lengths = 4 * np.ones(22)
gr3.drawcylindermesh(n, positions, directions, colors, radii, lengths)
gr3.export("grid.png", 1000, 1000)
As an aside: 0 * gr3.GR3_SurfaceOption.GR3_SURFACE_FLAT
is equal to 0
and therefore gr3.GR3_SurfaceOption.GR3_SURFACE_DEFAULT
.
from gr.
thanks! this looks like what i would like to achieve. i did not think of the cylinder option - i was considering that there must be some sort of 'line' primitive also in 3D with a constant width. the surface plot functions must also use something like that to draw the mesh, no? would a surface plot of a constant-zero function not also work?
the 0 * ..
bit was a quick test that i mistakenly copied-and-pasted.
from gr.
GR3 does not support 2D primitives like points and lines, so cylinders or cuboids would be the way to go for a grid. The gr3_createsurfacemesh
function creates a 3D mesh based on the x, y and z arrays.
from gr.
i think i misunderstood what gr3_createsurfacemesh
does. i thought it generates a wireframe-like surface representation. but instead it generates a surface mesh which is rendered as a solid surface -- correct?
from gr.
Correct. Together with functions like gr3.surface
and gr3.drawsurface
it serves as somewhat of an equivalent to gr.surface
.
from gr.
Related Issues (20)
- Confirm file successfully written to or not - troubleshooting Julia/Plots/CI issue HOT 1
- Provide a verbatim mode
- soname versioning HOT 1
- Replace gethostbyname with getaddrinfo HOT 2
- Rotating polar plot coordinates? HOT 6
- Add Inter Font Support HOT 7
- Python: Is there a way to detect if a plot window has been closed? HOT 3
- 978b2a786834c7c7cd48542e802e857cd8d9302d brings link problem HOT 18
- Plotting multiple lines using C api HOT 4
- Polyline not plotting on simple example HOT 3
- JS Problems HOT 2
- When used as backend for matplotlib, GR can't export to svg HOT 6
- Performance Consistency Issues HOT 3
- Latest version from pip not working on Windows for NICOS HOT 6
- Update GR_jll to Qt6.5 HOT 2
- Javascript Polyline HOT 1
- Fill Entire Workspace Fullscreen using GKSQt HOT 10
- Python - Windows: GKS: Qt6 support not compiled in HOT 4
- how to get the RGBA imge data ,i do this,but get nothing HOT 5
- Ambiguous fonts license issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gr.