# CgeoModelGenerator

class `cee.geo.``CgeoModelGenerator`()

  Helper class for creating a Model from a .cgeo blob.

  The .cgeo blob is typically received from a web service or a local file.

  Usage:

      let geoModel = new cee.geo.GeometryModel();
      let modelGenerator = new cee.geo.CgeoModelGenerator(buffer, geoModel);
      modelGenerator.buildModel();

  ** CGEO format documentation **

      Int     Magic Number (2072003)
      Int     TextureCount
      Int     PartCount

      Textures (TextureCount number of this block):
           Int Index : Zero based index
           Int Width : Width of texture in pixels (see note below about dimensions)
           Int Height : Height of texture in pixels (see note below about dimensions)
           Int WrapMode : 1: Clamp To Edge, 2: Repeat
           Int MinFilter : 1: Nearest, 2: Linear, 3: Nearest Mipmap Nearest,
                           4: Nearest Mipmap Linear, 5: Linear Mipmap Nearest,
                           6: Linear Mipmap Linear
           Int MagFilter : 1: Nearest, 2: Linear
           ubyte\*Width\*Height  pixelData : First pixel is lower left corner

      Parts (PartCount number of this block):
           Int     PartId
           Int     Color (r,g,b,a)
           Int     NumVertices
           Int     HasNormals (1=true, 0=false)
           Int     TextureIndex (-1 for none)
           Int     NumPrimitives
           Int     VerticesPerPrimitive

           Vertices:
             3*float     vertex x,y,z

           Normals:
             3*float     vertex nx,ny,nz

           TextureCoordinates:
             2*float     vertex s,t

           Indices:
             <NumPrimitives*VerticesPerPrimitive>

  Notes:

  Texture dimensions: Generally we recommend using textures where the dimensions (height and width) are a power of two (2,4,8,16, etc). Non-POT2 texture are partially supported in WebGL, but requires the sampler to be configured without MipMaps and with wrap mode set to ClampToEdge.

  Color is r,g,b,a packet into one integer. Example with float colors (0..1 per component):

  > int intOpacity = (int)(opacity*255.0f); int intColor = (int)(color.r()*255.0f)<<24 | (int)(color.g()*255.0f)<<16 | (int)(color.b()*255.0f)<<8 | intOpacity;

Constructors

- `constructor`

Methods

- `buildModel`

## Constructors

`CgeoModelGenerator.``constructor`(cgeoBuffer, geoModel)

  Arguments: | cgeoBuffer (`ArrayBuffer`) – None geoModel (`GeometryModel`) – None

  Creates a new CgeoModelGenerator with the given input Cgeo array and output geometry model

  Return type: | CgeoModelGenerator

## Methods

### buildModel

`CgeoModelGenerator.``buildModel`(preserveSharpEdges)

  Arguments: | preserveSharpEdges (`boolean`) – None

  Adds parts to the input GeometryModel based on the content of the Cgeo array

  Return type: | void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Web in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...