Git Product home page Git Product logo

surfaceviz's Introduction

surfaceViz

A repo to showcase 3d surface plot experiments inside Rhino/IronPython.

  • Note: we don't employ any standard Python libraries like Numpy, Matplotlib, etc; as they are not compatible with the IronPython which is as .NET port of Python.
  • We mimiced the standard generation functions to build a set of visualization methods in RhinoCommon instead.
  • The system can produce Point Clouds, Meshes, and Surface representations.
  • Additional colorization routines are also encoded, which include a height-based colorizer, and an internal generation sequence visualizer, and various color gradients.

The repository currently hosts 10 general parametric surface equations, and the Super Formula equation.

  1. Enepper Surface
  2. Monkey Saddle
  3. Mobeus Strip
  4. Klein Bottle
  5. Egg Crate Surface
  6. Pringle Surface
  7. Dini's Surface
  8. Bump Surface
  9. Flower Surface
  10. Vault-like Surface
  11. Super Formula Surfaces

ENEPPER SURFACE

$$\displaylines{ \begin{aligned} x &= u\cos(v) - \frac{u^b \cos(bv)}{b} \\ y &= u\sin(v) + \frac{u^b \sin(bv)}{b} \\ z &= 2u^a \frac{\cos(av)}{a} \end{aligned} }$$

with

$$\displaylines{ \begin{aligned} 0 < u < 1.2 \\ -\pi < v < \pi \end{aligned} }$$

210625 18 6_ 2 0 scale 210624 87 210624 82 210624 03

View in 3D!

MONKEY SADDLE

$$\displaylines{ \begin{equation*} z = x^3 - 3xy^2 \end{equation*} }$$

This equation defines a surface in three dimensions where $z$ is a function of $x$ and $y$, with the height of the surface at any point $(x,y)$ determined by the expression $x^3 - 3xy^2$. The Monkey Saddle is a saddle-shaped surface, with two saddle points at $(0,0)$ and $(\pm\sqrt{3/2},0)$.

210614 01 img9 1

MOBEUS STRIP

$$\displaylines{ \begin{align*} x &= (1 + \frac{v}{2}\cos(\frac{1}{2}u))\cos(u) \\ y &= (1 + \frac{v}{2}\cos(\frac{1}{2}u))\sin(u) \\ z &= \frac{v}{2}\sin(\frac{1}{2}u) \end{align*} }$$

This defines the three-dimensional function $(x, y, z)$, which is a parametric surface defined over the ranges $u \in (0, 2\pi)$ and $v \in (-1, 1)$.

210622_01

KLEIN BOTTLE

$$\displaylines{ \begin{align*} x &= aa + \cos\left(\frac{v}{2}\right)\sin u - \sin\left(\frac{v}{2}\right)\sin(2u)\cos v \\ y &= aa + \cos\left(\frac{v}{2}\right)\sin u - \sin\left(\frac{v}{2}\right)\sin(2u)\sin v \\ z &= \sin\left(\frac{v}{2}\right)\sin u + \cos\left(\frac{v}{2}\right)\sin(2u) \end{align*} }$$

This defines the three-dimensional function $(x, y, z)$, which is a parametric surface defined over the ranges $u \in (0, 2\pi)$ and $v \in (0, 6)$.

210623 07_triColorizationRoutines 3

EGG CRATE SURFACE

$$\displaylines{ \begin{equation*} z = \sin(xh_2) \cdot \cos(yh_2) \cdot h_1 \end{equation*} }$$

where $x$ and $y$ are defined as follows:

$$\displaylines{ \begin{equation*} x = \begin{cases} -v, & -v < x < v \\ v, & \text{otherwise} \end{cases} \quad \text{and} \quad y = \begin{cases} -v, & -v < y < v \\ v, & \text{otherwise} \end{cases} \end{equation*} }$$

This defines a surface in three dimensions where $z$ is a function of $x$ and $y$, with $x$ and $y$ constrained to the square region $-v &lt; x, y &lt; v$. The height of the surface at any point $(x,y)$ is proportional to $\sin(xh_2)\cos(yh_2)$ and scaled by the constant $h_1$.

210614 01_210618 01_K

PRINGLE SURFACE

$$\displaylines{ \begin{equation*} z = \begin{cases} \sin(x^4) + \cos(y^4), & 0 < x < u \sin(v) \text{ and } 0 < y < u \sin(v) \\ 0, & \text{otherwise} \end{cases} \end{equation*} }$$

210623 03

DINI'S SURFACE

$$\displaylines{ \begin{aligned} \begin{equation*} f(u,v) = \left(\cos(u)\sin(v), \sin(u)\sin(v), \cos(v) + \log\left(\tan\left(\frac{v}{2}\right)\right) + a u\right), \end{equation*} \end{aligned} }$$

with

$$\displaylines{ \begin{aligned} 0 \leq u \leq 2\pi \\ 0 < v < \pi \end{aligned} }$$

210623 06

BUMP SURFACE

$$\displaylines{ \begin{equation*} z = e^{-(x^2+y^2)}h \end{equation*} }$$

where $x$ and $y$ are defined as follows:

$$\displaylines{ \begin{equation*} x = \begin{cases} -v, & -v < x < v \\ v, & \text{otherwise} \end{cases} \quad \text{and} \quad y = \begin{cases} -v, & -v < y < v \\ v, & \text{otherwise} \end{cases} \end{equation*} }$$

This defines a surface in three dimensions where $z$ is a function of $x$ and $y$, with $x$ and $y$ constrained to the square region $-v &lt; x, y &lt; v$. The height of the surface at any point $(x,y)$ is proportional to $e^{-(x^2+y^2)}$ and scaled by the constant $h$.

210616 09

FLOWER SURFACE

$$\displaylines{ \begin{equation*} z = \sin(\sqrt{x^2+y^2}) \cdot h \end{equation*} }$$

where $x$ and $y$ are defined as follows:

$$\displaylines{ \begin{equation*} x = \begin{cases} -v, & -v < x < v \\ v, & \text{otherwise} \end{cases} \quad \text{and} \quad y = \begin{cases} -v, & -v < y < v \\ v, & \text{otherwise} \end{cases} \end{equation*} }$$

This defines a surface in three dimensions where $z$ is a function of $x$ and $y$, with $x$ and $y$ constrained to the square region $-v &lt; x, y &lt; v$. The height of the surface at any point $(x,y)$ is proportional to $\sin(\sqrt{x^2+y^2})$ and scaled by the constant $h$.

210614 01 img10 1

VAULT-LIKE SURFACE

$$\displaylines{ \begin{equation*} z = h_1 - (x^2 + y^2) \end{equation*} }$$

where $x$ and $y$ are defined as follows:

$$\displaylines{ \begin{equation*} x = \begin{cases} -v, & -v < x < v \\ v, & \text{otherwise} \end{cases} \quad \text{and} \quad y = \begin{cases} -v, & -v < y < v \\ v, & \text{otherwise} \end{cases} \end{equation*} }$$

This defines a surface in three dimensions where $z$ is a function of $x$ and $y$, with $x$ and $y$ constrained to the square region $-v &lt; x, y &lt; v$. The height of the surface at any point $(x,y)$ is proportional to the difference between a constant value $h_1$ and the sum of the squares of $x$ and $y$.

210616 31

SUPER FORMULA SURFACES

$$\displaylines{ r(\varphi) = (|\frac{cos(\frac{m\varphi}{4})}{a}|^{n_2} + |\frac{sin(\frac{m\varphi}{4})}{b}|^{n_3})^{-\frac{1}{n_1}} }$$

by choosing different values for the parameters a,b,m,n_1,n_2,n_3, different shapes can be generated. It is possible to extend the formula to 3,4, n dimensions, by means of the spherical product of superformulas. The parametric equations are as follows:

$$\displaylines{ x = r_1(\theta)cos\theta \cdot r_2(\phi)cos\phi \\\ y = r_1(\theta)sin\theta \cdot r_2(\phi)cos\phi \\\ z = r_2(\phi)sin\phi \\\ }$$

where

$$\displaylines{ -\frac{\pi}{2} > {\phi} > \frac{\pi}{2} \\\ -{\pi} > {\theta} > {\pi} \\\ }$$

__210714 04_typeD __210714 04_typeB

210714 28_msh-colored_1

210714 11_msh-colored

View in 3D! (shape transitions)

210715 01_transparentPlasticSurface

210714 04

View in 3D!

210715 04_colorRange

210714 01

View in 3D!

Capture_GH1

Source: Math Equations on my GitLab Repo

surfaceviz's People

Contributors

gasingh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.