Coder Social home page Coder Social logo

photonfileeditor's People

Contributors

andoryuuta avatar nardj avatar reonarudo avatar x3msnake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photonfileeditor's Issues

User UI feature requests

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


Input/Output

  • Create new file
  • Import bitmaps
  • Set default values for the fields
  • Save and load settings from a list (resin settings)
  • Export images from a photon file
  • Replace image based on current layer/frame

Navigation

  • Allow up/down arrow to navigate layer / frames
  • Implement Slider drag

Visualization

  • Implement @Rob2048 3D visualization voxel engine

Tools

  • Implement @Antharon voxel hollowing algorithm
  • Allow setting and propagating a standard layer height (layers are set in absolute values it's a pain to manual edit)
  • Allow to image range as multiple exposures (to be able to print 2 files with different exposures at the same time (user would have to supply a image with the 2 models and one with only 1)
  • Add Gerber to photon interpreter tool @Reonarudo

Distribution

  • Create self contained releases (maybe we can use travis like @lexelby does at inkstitch?)

Test script for new releases

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)

  1. Go to development branch
    • Download zip, extract and run PhotonFileEditor.py
    • Does PFE start?
    • Can we open a new file
    • Export bitmaps
    • Open smilie.photon
    • Replace a bitmap by exported bitmap
    • add number to all settings for a couple of layers
    • Save photonfile to test.photon
    • Load test.photon
    • See if images and settings are the same (not mirrored/garbeld).
    • Confirm that the layer height is always going up and not down
      _
  2. Open AnyCubic Photon Slicer V1.3.6
    • Load test.photon
    • See if images (multiple layers) and settings are the same.
      _
  3. Merge development branch with master

Delete current layer

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

image

I feel this last idea can be improved with some debate.

Add these guys to the team members when you can ;)

@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

Memory effective flood fill

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?

How to protect Master from commits

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?

image

What's the reasoning behind changing up/down behaviour? (NF)

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?

Branch Master: Not working

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.)

Create new file from image/images

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

STL loader

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?)

Code annotation - Review needed

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

  • Followed bij Remark block.
    image

  • All methods are started with a docstring stating its purpose

  • And purpose of each block is stated as remarks
    image

What I did not do is add type hints, but I think this is usefull too.
image

So let me know what you think!

See also:

Instalation step-by-step tutorial - wip

Rev.20180621


Goto the project github and download the source zip file

image

image


Download and Install Python 3 from https://www.python.org/downloads/

image

image


From the windows menu Search cmd and run as admin

image


run python --version into the command line to confirm that your are running version 3.0 or above.

image


run python -m pip install --upgrade pip to install the latest package manager

image


run python -m pip install -U pygame --user to install the required library to run PhotonFileTools

image


Unzip PhotonFileUtils-master.zip to the root of your C:\Drive

image


Change directory by typing cd C:\path\to\your\unzipped\files

image

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

image

image

Wrong image size crash were a popup warning should exist!

image

The software should not exit if it enconters a error. Doing this means the user will lose all changes he has done to the file.

In this particular case a error message should be displayed and the command ignored returning to the program menu.

Export photon file to images

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

About box - Your names?

I have updated the about box (branch New features) and added your info. Can you let me know if you want to be mentioned are not? :-)

image

Filling wiki

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.

install numpy for faster import/export/navigating slice images

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.

Unknown fields

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!")
}

Disclaimer - Use at own risk

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.

Integration of different tools/projects

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?

Decoding second preview image

When decoding the second preview image the same like the first I get an image which does not look right:
image

Is the color encoding really (like the first preview image) 2 bytes (little endian) with each bit like RRRRR GGG GG X BBBBB

New-Features branch merged / Master fixed / testing needed

@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:

  • Copy/Paste/Delete/Duplicate of layers
  • Undo the actions above.
  • Resin settings can be applied
    And the GUI is improved:
  • Tooltips for all textboxes and layer toolbar icons
  • Iconbar to do basic layer operations (Copy/Paste/Delete/Duplicate)
  • Fast Layer Scrollbar

image

Bug: Import/encoding images not working

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"

OSX/Anaconda has issues

Reonarudo encountered problems with OSX 10.13.5 and Anaconda (see #10):

  • When debugging PhotonFileUtils window does not show up (it does however if run directly terminal )
  • Mouse clicks seem not to be at cursor tip. Dragging the windows crashed it.

Icons needed for basic edit operations

I have added cut/copy/paste/duplicate functionality and also added a icon bar (see bottom left).
However I can't find any nice (monochrome?) icons which are public domain and of the same style.
Anyone any ideas?

image

Branch New-features: wrong slice addresses

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.

Context replace layer and preview images

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)

Undo

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

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.