Exemple #1
0
# -*- coding: UTF-8 -*-

from caid.cad_geometry import cad_geometry
from evaluator import CurveEvaluator, SurfaceEvaluator, VolumeEvaluator
from numpy import array, asarray
from OpenGL.GL import *
from theme import theme as Theme
from global_vars import strtoArray

theme = Theme()

ALPHA = theme.alpha
BETA = theme.beta
COLOR_DEFAULT_GEOMETRY = theme.color_viewer("default_geometry")
COLOR_DEFAULT_PATCH = theme.color_viewer("default_patch")
COLOR_DEFAULT_MESH = theme.color_viewer("default_mesh")
COLOR_DEFAULT_POINTS = theme.color_viewer("default_points")
SIZE_GEOMETRY_POINTS = theme.size_points("geometry")
SIZE_PATCH_POINTS = theme.size_points("patch")


def pointsToList(points):
    x = points[..., 0]
    y = points[..., 1]
    z = points[..., 2]
    n = asarray(points.shape[:-1]).prod()
    x = x.reshape(n)
    y = y.reshape(n)
    z = z.reshape(n)

    return x, y, z
Exemple #2
0
# -*- coding: UTF-8 -*-
import wx
import numpy as np

from theme import theme as Theme

theme = Theme()

ALPHA = theme.alpha
BETA = theme.beta
COLOR_GEOMETRY_MESH = theme.color_selected_geometry('mesh')
COLOR_GEOMETRY_NURBS = theme.color_selected_geometry('nurbs')
COLOR_GEOMETRY_POINTS = theme.color_selected_geometry('points')
COLOR_PATCH_MESH = theme.color_selected_patch('mesh')
COLOR_PATCH_NURBS = theme.color_selected_patch('nurbs')
COLOR_PATCH_POINTS = theme.color_selected_patch('points')
COLOR_DEFAULT_GEOMETRY = theme.color_viewer('default_geometry')
COLOR_DEFAULT_PATCH = theme.color_viewer('default_patch')
COLOR_DEFAULT_MESH = theme.color_viewer('default_mesh')
COLOR_DEFAULT_POINTS = theme.color_viewer('default_points')
SIZE_GEOMETRY_POINTS = theme.size_points('geometry')
SIZE_PATCH_POINTS = theme.size_points('patch')


class Page2DGrid(wx.Panel):
    def __init__(self, parent, viewer):
        wx.Panel.__init__(self, parent.nb)
        self.title = "2D Grid"
        pnl = self
        self.parent = parent
        self.viewer = viewer
Exemple #3
0
# -*- coding: UTF-8 -*-
import wx
import numpy as np

from theme import theme as Theme

theme = Theme()

ALPHA                   = theme.alpha
BETA                    = theme.beta
COLOR_GEOMETRY_MESH     = theme.color_selected_geometry('mesh')
COLOR_GEOMETRY_NURBS    = theme.color_selected_geometry('nurbs')
COLOR_GEOMETRY_POINTS   = theme.color_selected_geometry('points')
COLOR_PATCH_MESH        = theme.color_selected_patch('mesh')
COLOR_PATCH_NURBS       = theme.color_selected_patch('nurbs')
COLOR_PATCH_POINTS      = theme.color_selected_patch('points')
COLOR_DEFAULT_GEOMETRY  = theme.color_viewer('default_geometry')
COLOR_DEFAULT_PATCH     = theme.color_viewer('default_patch')
COLOR_DEFAULT_MESH      = theme.color_viewer('default_mesh')
COLOR_DEFAULT_POINTS    = theme.color_viewer('default_points')
SIZE_GEOMETRY_POINTS    = theme.size_points('geometry')
SIZE_PATCH_POINTS       = theme.size_points('patch')

class Page2DGrid(wx.Panel):
    def __init__(self, parent, viewer):
        wx.Panel.__init__(self, parent.nb)
        self.title = "2D Grid"
        pnl = self
        self.parent = parent
        self.viewer = viewer
Exemple #4
0
# -*- coding: UTF-8 -*-

from caid.cad_geometry import cad_geometry
from evaluator import CurveEvaluator, PatchEvaluator
from numpy import array, asarray
from OpenGL.GL import *
from theme import theme as Theme
from global_vars import strtoArray

theme = Theme()

ALPHA                   = theme.alpha
BETA                    = theme.beta
COLOR_DEFAULT_GEOMETRY  = theme.color_viewer('default_geometry')
COLOR_DEFAULT_PATCH     = theme.color_viewer('default_patch')
COLOR_DEFAULT_MESH      = theme.color_viewer('default_mesh')
COLOR_DEFAULT_POINTS    = theme.color_viewer('default_points')
SIZE_GEOMETRY_POINTS    = theme.size_points('geometry')
SIZE_PATCH_POINTS       = theme.size_points('patch')



def pointsToList(points):
        x = points[...,0]
        y = points[...,1]
        z = points[...,2]
        n = asarray(points.shape[:-1]).prod()
        x = x.reshape(n)
        y = y.reshape(n)
        z = z.reshape(n)
Exemple #5
0
# -*- coding: UTF-8 -*-

from caid.cad_geometry import cad_geometry
from evaluator import CurveEvaluator, SurfaceEvaluator, VolumeEvaluator
from numpy import array, asarray
from OpenGL.GL import *
from theme import theme as Theme
from global_vars import strtoArray

theme = Theme()

ALPHA = theme.alpha
BETA = theme.beta
COLOR_DEFAULT_GEOMETRY = theme.color_viewer('default_geometry')
COLOR_DEFAULT_PATCH = theme.color_viewer('default_patch')
COLOR_DEFAULT_MESH = theme.color_viewer('default_mesh')
COLOR_DEFAULT_POINTS = theme.color_viewer('default_points')
SIZE_GEOMETRY_POINTS = theme.size_points('geometry')
SIZE_PATCH_POINTS = theme.size_points('patch')


def pointsToList(points):
    x = points[..., 0]
    y = points[..., 1]
    z = points[..., 2]
    n = asarray(points.shape[:-1]).prod()
    x = x.reshape(n)
    y = y.reshape(n)
    z = z.reshape(n)

    return x, y, z