sree314 / stepcvt Goto Github PK
View Code? Open in Web Editor NEWGenerate STL files for 3D printing from STEP files
Generate STL files for 3D printing from STEP files
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.
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.py from jupyter-cadquery into the stepcvt package so we don't require jupyter-cadquery as dependency.
Implement CLI subparser for choices module,
functionalities include but not limited to:
This involves implement the to_dict
and from_dict
, as well as patching up the init method.
update from_dict to accept a root
Implement the add_source
function in the Project class.
Also write a test that prevents duplicate partinfo for the same partid.
The to_dict()
in project
class does not have a corresponding test in test_project.py
that checks for individual partinfo - sree
Fix the functionality of to_dict()
and from_dict()
in project
class - Samantha
./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'
Please edit cli_test.py, fix the bugs you encounter
# if args.command == "make"
# something else
# else
# p = load_from_json(args.jsonFile)
# sys.exit(args.func(args))
Please edit cli_test.py, run it and fix the issues
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.
Implement load_step_file
in CADSource.
Failed with:
usage: stepcvt [-h] [-j JSONFILE] {addpart,rmpart,editpart,choices,newProjName,make,display} ...
stepcvt: error: unrecognized arguments: test
Level 2 deserialization loads the json config without loading the STEP files. This would be done by having load
function for every classes.
Implement the parts()
method of CADSource.
Platform dependent tests should include MacOS by checking for POSIX rather than only Linux
Add step file
Delete step file
List parts of step file
At this moment, this is just the serialization and deserialization functions, as tested in test_project.py
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.
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.
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
stlconvert jsonfile partid --rotation --angularTolerance --tolerance
listConversionsApplied --> returns a list of parts that have been sent to stlconvert
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.
Add exportall subcommand in CLI
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.
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?
Right now the command line options related to part only support one source being added.
The command head for adding part(s) to a specified source should be:
stepcvt -j [jsonfile] addpart [source_name]
...
The command head can be followed by --all
or a list of part_ids.
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]
This requires coordination with STLConversionInfo changes in Issue #23
Please edit cli_test.py, fix the bugs you encounter
[-j] [json file path/name.json] [specific project "name"]
[-j] [json file path/name.json]
[-n] [specific project "name"]
[-j] [json file path/name.json]
[-j] [json file path/name.json] [-n] [new "name"]
[-n] [new "name"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.