Giter VIP home page Giter VIP logo

figura's Introduction

Software engineer for scientific projects and not only.

Languages

C++ C Python

Stats

Find me

Gmail Github

figura's People

Contributors

andrsd avatar

Stargazers

 avatar

Watchers

 avatar  avatar

figura's Issues

export function

To simplify exporting into multiple file, create a simple export function, so people can do:

export(<output_file_name>, [shape1, shape2, ...], format="step")

named solid shapes

  • allow to store shape names in STEP files
  • for STL export, use the shape name for file names, so get one file per shape like this:
    • file base - shape name.stl
    • if shape name is empty, we could use some index - file base - 0.stl (or we can name shapes automatically?)

References:

Circular pattern

Create a class for doing circular pattern

User would specify:

  • origin
  • start angle, end angle
  • number of instances
  • radius
  • shape to pattern

Units

  • allow to specify units of the model
  • allow to specify units for the output file (STEP only)

STEP Exporter

Create an object for exporting to STEP.

Basically wrapping this code snippet

import OCC.Core.STEPControl as step

step_writer = step.STEPControl_Writer()
step_writer.Transfer(shp.shape(), step.STEPControl_AsIs)
step_writer.Write(file_name)

STL Exporter

Create object for STL export

Basically wrapping this code snippet:

from OCC.Core.StlAPI import StlAPI_Writer
from OCC.Core.BRepMesh import BRepMesh_IncrementalMesh

# meshing params
linear_deflection = 0.9
angular_deflection = 0.1

writer = StlAPI_Writer()
writer.SetASCIIMode(not binary)
for idx, shp in enumerate(shapes):
    mesh = BRepMesh_IncrementalMesh(shp.shape(), linear_deflection, False, angular_deflection, True)
    mesh.Perform()
    if not mesh.IsDone():
        raise AssertionError("Mesh is not done.")
    fn = "{}.{}.stl".format(file_name, idx)
    success = writer.Write(shp.shape(), fn)

Linear pattern

Create a class for doing linear patterns.

User would specify:

  • origin
  • dx, dy
  • number of instances in x- and y-direction
  • shape to pattern

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.