photonsters / photonfileeditor Goto Github PK
View Code? Open in Web Editor NEWUtilities to display, make and edit files for the Anycubic Photon printer
License: GNU General Public License v3.0
Utilities to display, make and edit files for the Anycubic Photon printer
License: GNU General Public License v3.0
Here's a first draft of some of the capabilities i can quickly think of.
@ALL Feel free to edit this post and add or cross out items as we go
Issue 32 shows we really need a test script to test new releases before merging them with Master branch.
Following items should be tested (please add/edit when needed)
Allow user to delete the layer he is looking at.
we should in a near future implement a undo #19 as alternative we can instead of deleting the layer just allow the user to mark the layer for deletion, and must hit commit so that the layer deletion are processed.
I think this last idea make more sense it would look something like this
I feel this last idea can be improved with some debate.
@Reonarudo
This is Leonardo from altLab Collective the maker of the PCB2PHOTON project and the hex template that made exposure test possible, we need to convince him to add his pcb2photon to this project.
@Antharon
This is Ivan, came to us from the Photon forum, contacted me trough Fuste in the Anycubic Group. He wants to develop the algorithm to hollow models from 2D slices, he can also help with the 3D voxel visualization
These features added to the project can make the editor a cool swiss knife tool for modifying photon files
Hello people, from selfish reason, first feature from voxel filters, that I want to implement is hole filling algoritm.
I already canibalised robs script for extraction of voxel box from file and started to play with it. First problem is, that I need to implement flood fill. There is a huge problem. I quickly written 3d version of it, run program and of course I overflown call stack with recursive calls (every pixel produced six more calls recursivelly).
Is there a efective memory safe implementation?
When we double click in a textfield it should highlight allowing to delete the text there
I am searching the web how to protect the master branch from (accidental) commits by myself. I want the commits to be to another development branch which will eventually be merged. However I can't find anything usefull.
I found the setting Branch Protection for master, however as I understand this only protects from merges and not from commits. Any ideas?
Dunno if it was intentional, but the up down button is switched from what it was on the MB.
For me it makes more sense as it was before up you go up one layer, unless you were starting the file from the top down.
My guess is that you align the up/down with the sliderbar, the problem is the bar should start in the bottom instead of the top since the layers start bottom up.
@NardJ
Can you clarify your reasoning behing this?
A accidental upload of PhotonEditor.py to Master instead of New-features branch has rendered the Master branch to be not working. The readme is updated. An test of the new-features branch should be done as soon as possible (tonight?). (New Master should be better protected against accidental uploads.)
Allow user to create a file from image sequence filename_#.png and set layer height and exposure times as anycubic slicer defaults
If only one image is supplied the file should be set as 0 base layers and 1 normal layer
I am thinking about implementing a STL loader. Shouldn't be to hard to generate slicer.
Would this be a good thing or not something PhotonFileUtils should do? (There isn't any overlap with the Voxel Engine isn't there?)
I just did some basic code cleanup and annotation (see branch New-features). I am wondering if this is enough to make the code editable for others or there are things missing. Hoping for your advise!
What I did so far:
All py files start with a docstring (""" bla bla """) which states its purpose
Followed by dunders for version and author
Followed by import where internal libraries are first, downloaded libraries second and self-build libraries last
All methods are started with a docstring stating its purpose
What I did not do is add type hints, but I think this is usefull too.
So let me know what you think!
See also:
Rev.20180621
Goto the project github and download the source zip file
Download and Install Python 3 from https://www.python.org/downloads/
From the windows menu Search cmd and run as admin
run python --version into the command line to confirm that your are running version 3.0 or above.
run python -m pip install --upgrade pip to install the latest package manager
run python -m pip install -U pygame --user to install the required library to run PhotonFileTools
Unzip PhotonFileUtils-master.zip to the root of your C:\Drive
Change directory by typing cd C:\path\to\your\unzipped\files
you can open the folder in windows explorer and copy the path on the top bar and right click/paste on the comand box window
Finally run python PhotonEditor.py and enjoy
Allow introduction of values with numpad and cycling fields with enter and tab
this makes up for faster insertion of numerical data
With a photon file open have a export feature to export each layer to images as filename_#.png
Where # is the number of the layer
I have started a wiki to document possible install problems and document functionality which is implemented. If you are missing info on the wiki, please feel free to add or reply here.
Since it isn't as clear in the closed issues: The newest version checks if the numpy library is available. If so it uses this library to decode/encode images. This makes faster exporting and importing of images possible. Also navigating through image layers and 'animating' the image stack by dragging the slider bar at the right edge of the layer image is possible.
I seems that, at least from the readme photo, you are currently missing a few of the non-zero fields. I compared mine with the template from Reonarudo that I think you are using, here are the differences:
unknown3 = Preview Header Offset
unknown4 = Layer Headers Offset
unknown5 = Preview Thumbnail Header Offset
unknown7 = LightCuring/Projection type // (1=LCD_X_MIRROR, 0=CAST)
Also, fair warning; some offsets seem to seek relatively depending on the MSB being set. In specific, I know the MSB is used for the offset within the layer image headers, and it is probably used for the the offset within the preview image headers. I have yet to actually come across this being used in any .photon
or .cbddlp
files (although I've only tested very small files from both versions of the slicer(s)), nor have I been able to figure out the firmware update format to disassemble and verify its usage.
Regardless, you might want to add a simple check like:
if(LayerHeader.ImageDataOffset&0x80000000 != 0) {
panic("Potentially non-implemented relative seek!")
}
// and
if(PreviewHeader.ImageDataOffset&0x80000000 != 0) {
panic("Potentially non-implemented relative seek!")
}
Yesterdag I found a bug in the New-features branch which generated layers at a lower position than the previous layer. This could make the Photon drive it resin-model back into the LCD display.
Because of this I think it would be good to add an disclaimer to the project. What do you think?
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I was wondering about our different projects and codebases. We decided upon using Python as common code base, but at this will take some time. It should be possible to invoke (command line) tools form within Python and parsing the results. At first we could choose to integrate all tools by using this and take our time to convert them all to Python....That is if it is really needed. I can imagine a Voxel engine is faster in C++ than in Python. What do you think?
Prepare the project for easy deployment, both for development and execution.
There is a table curated by artus fuste and me that has good starting points for resins
https://docs.google.com/spreadsheets/d/1crvzMnt_8NJXAsABinoIhcOjE8l3h7s0L82Zlh1vkL8/edit#gid=0
maybe we can use this table to populate the software stock resin exposure times
This non issue can be used for discussion
@Reonarudo, @Rob2048 , @Antharon , @Andoryuuta , @X3msnake
Since the Master branch was not working, I merged New-features. I did a test myself and all seems ok. However I would appreciate a test from you guys! Our findings will be used for a new branch.
Some of the new features are:
On import of images (Edit menu), the (png-)images have to be encoded in B/W RLE format. The encoded data is stored and slice 0 is displayed on screen. The displayed image has the right contours, but after each contour a random number of the (same) color is displayed. The encoded image does have the correct number of bytes, so compression is correct, but encoding each byte with info about color en nr of pixel is probably incorrect.
The problem probably is that the color value which is used in the encoded byte is the color of the first pixel which broke the repetition instead of the color of the repetition itself. If this is the case the code "encValue = color << 7 | nr" should be replaced by "encValue = prevcolor << 7 | nr"
Hey Masters, lets debate a bit on the best way to bring 3D visualization to the PFU.
Any ideas on how we can go about with it and timeframes for implementation?
Reonarudo encountered problems with OSX 10.13.5 and Anaconda (see #10):
The saved file from the new-features branch does not yet have correct image addresses after copy/cut/past/duplicate actions.
This bug becomes visible (as shifted images) on loading the resulting photon file in Anycubic Photonslicer.
Based on a valid open photon file, and using the context of user current view allow to replace that image with a new image.
Inform the user and validate that user input image corresponds to the correct context size (photon layer / preview 1 / preview 2)
Backspace if cursor is at beginning of word or Delete if cursor at end of word, causes new text in textbox
This is probably not a easy one to implement
but having a feature like #18 we should try to implement some kind of undo to account for accidental deletions
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.