External models - HiStructClient/femcad-doc GitHub Wiki

Currently, Histruct has support for .obj models only. Desktop FemCAD does not show external models.

OBJ models

OBJ models usually consist of several files:

  • .obj - geometries definiton (vertexes, meshes, ...)
  • .mtl - materials definition (color, opacity, ...)
  • .jpg, .tga, ... - textures images

All files belonging to the model should be in one folder.

Files location

All files must be placed in Azure histructstatic blob storage, specifically in any subfolder of models/objModels/. Model with external texture (usually .jpg file) must be deffined as .json file in any subfolder of models/objsonModels/.

JSON definition file

The JSON definition file is necessary for a model with "external" defined textures or a model with files in different folders. If textures are defined in .mtl file, then don't add the path of the texture to the definition. Structure of the file:

{
  "obj" : "objModels/tractor/tractor02/Tractor.obj",
  "mtl" : "",
  "texture" : "objModels/tractor/tractor02/Texure Tractor.jpg"
}

mtl and texture aren't required. Place the definition file to any subfolder of models/objsonModels/.

Insert model to scene

Create fcs file with the proper name according to one of these rules:

  • __threejs_objmodel_[path_to_obj].fcs - for model consist of obj file and mtl file in same folder with same name. Material file (mtl) is required.
  • __threejs_objmodel_[path_to_obj]_MTL_[path_to_mtl].fcs - for model consist of obj file and mtl file in defferent folders. Material file (mtl) is required.
  • __threejs_objmodel_[path_to_obj]_MTL_.fcs - for model consist of obj file. Material file isn't used.
  • __threejs_objsonmodel_[path_to_json].fcs - for model with definition in json file.

The path_to_xxx is relative path from models/obj(son)Models/ folder to obj file without extension. Slashes (/) in path must be replaced by (_).

In fcs file must be defined same unique geometry, eg.:

a := 0.013565  # must be unique for different models

vertex {v1} xyz (0) (0) (0)
vertex {v2} xyz (a) (0) (0)

curve {c1}  vertex v1 v2