Giter VIP home page Giter VIP logo

stepcvt's People

Contributors

adirablumenthal avatar asai-yume avatar redrn avatar skriegsman avatar sree314 avatar ymh1003 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

stepcvt's Issues

Implement CADSource

The tests are in test_cadsource.py.

This involves the to_dict and from_dict functions.

The to_dict function needs to be path aware, check the tests for more information.

Licensing

From our discussion in class, we've decide to adopt the GPLv3 for this project. Please sign off acknowledging this.

I'll add the LICENSE file and the appropriate copyright text.

Move StepReader into stepcvt

Move stepreader.py from jupyter-cadquery into the stepcvt package so we don't require jupyter-cadquery as dependency.

subparser for choices module

Implement CLI subparser for choices module,
functionalities include but not limited to:

  • define choices
  • edit choices
  • remove choices
  • apply choices to parts

step_export_all_fails.py

./stepcvt_export_all.py /path/to/voron/Voron-Stealthburner/CAD/Printheads/Stealthburner_Printhead_V6.stp /tmp/

fails with this error:

Traceback (most recent call last):
  File "./stepcvt_export_all.py", line 74, in <module>
    for partid, obj in source.parts():
  File "stepcvt/stepcvt/project.py", line 62, in parts
    assemblies = self._CADSource__step.assemblies
AttributeError: 'NoneType' object has no attribute 'assemblies'

Edit cli_test

Please edit cli_test.py, fix the bugs you encounter

Load and write to json file in scripts

load from JSON function

write to JSON function

# if args.command == "make"
#   something else
# else 
    # p = load_from_json(args.jsonFile)
    # sys.exit(args.func(args))

Edit cli_test

Please edit cli_test.py, run it and fix the issues

STL rotation

Implement a rotate() method in STLConversionInfo that takes in a CADquery object and rotates it according to the rotation information stored in the STLConversionInfo object.

Also write a test for this. You can use the models in models.py to obtain test cadquery objects.

Project CLI test fails

Failed with:
usage: stepcvt [-h] [-j JSONFILE] {addpart,rmpart,editpart,choices,newProjName,make,display} ...
stepcvt: error: unrecognized arguments: test

Level 2 Deserialization

Level 2 deserialization loads the json config without loading the STEP files. This would be done by having load function for every classes.

Implement Project

At this moment, this is just the serialization and deserialization functions, as tested in test_project.py

Implement PartInfo

The tests are in test_part_info.py.

This involves the conversion to and from dictionaries, but in particular, since partinfo can contain objects of different types, the correct from_dict must be called in from_dict.

Implement the choices framework

I've implemented the data model choices as classes in stepcvt/choices/__init__.py in the choices-ui branch. The choices framework intends to represent user choices that affect which parts will eventually be printed.

Samantha's notes from class can be found here:

https://github.com/sree314/csc293-fall23/blob/main/tech-planning/DataModelForChoices.md

There are no tests, but please write tests before writing code, so we're clear about the specification. Feel free to email me and/or comment on this issue to figure out what the intention of each of those classes is.

The rough pseudocode portion of the notes can be ignored for now, that code represents how to apply a user's choices to the generation of STL files.

You can work in the choices-ui branch.

Add support to stepcvt_export_all to limit the parts exported and support custom rotations

Currently stepcvt_export_all exports all parts in the STEP file according to an arbitrary rotation.

This is an experiment to see if a lightweight CLI-based STL exporter can be built.

Add support for a command line option --partid that lists parts to be exported:

stepcvt_export_all.py file.step --partid part1 --partid part2

should only export parts with those partid.

Also add support for command line option --rot that can apply custom rotations to a part:

stepcvt_export_all.py file.step --partid part1 --rot 0,45,0

will export only partid part1 with rotation around Y-axis of 45 degrees.

You may also want to include a command-line option --exclude to export all objects except those specified by --exclude

stepcvt_export_all.py file.step --exclude part2

TaskInfo CLI

stlconvert jsonfile partid --rotation --angularTolerance --tolerance
listConversionsApplied --> returns a list of parts that have been sent to stlconvert

Generate test assemblies using CADQuery

We'll need test STEP models for running our tests. Although we can use existing STEP models, we'll create a few simple models to keep our tests running fast and to avoid downloads.

Create a models.py file in the tests directory with a function per model. Each function should return a CADQuery assembly. You can use the tutorial models in CADQuery to start with.

Serialization and deserialization for classes in Choices framework

Needs from_dict, to_dict and related test functions implemented for classes in Choices framework. This would also mean that classes, including Project and PartInfo need to update their from_dict/to_dict with test functions because they contain classes in Choices framework.

"stepcvt" not found as a command

Both Yumeng and I are encountering the problem of not being able to run the executable properly, could it be something wrong when installing the dependency on Windows/Mac OS?

Support command line options related to part class for CLI

Add support for command addpart:
jsonfile addpart [partid1] [partid2] that adds parts with id partid1 and partid2
jsonfile addpart --all that adds all parts in the source
Add support for command rmpart:
jsonfile rmpart [partid1] [partid2]
Add support for command editpart that changes the count for the part specified by its part id:
jsonfile editpart [partid] -c [count]

Edit cli_test

Please edit cli_test.py, fix the bugs you encounter

newProject, editProject CLI for A7

  1. Create project and make a new json file to be filled in
    • If no .json file specified, use default file "stepcvt.json"
    • If no name specified, use default name "proj"

[-j] [json file path/name.json] [specific project "name"]
[-j] [json file path/name.json]
[-n] [specific project "name"]

  1. Display existing project from an existing json file
    • If no .json file specified,
      • If the current directory has only one .json file,
    • Then use the only exisitng .json file.
      • If there is more than one possible json file,
    • Try to use default file "stepcvt.json" if it exists.
    • If that fails, throw an error

[-j] [json file path/name.json]

  1. Edit name, etc. in a given json file (or default json file)
    • If no .json file specified,
      • If the current directory has only one .json file,
    • Then use the only exisitng .json file.
      • If there is more than one possible json file,
    • Try to use default file "stepcvt.json" if it exists.
    • If that fails, throw an error
    • If no "name" given, throw an error

[-j] [json file path/name.json] [-n] [new "name"]
[-n] [new "name"]

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.