Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


6 Pages123>»
Options
Go to last post Go to first unread
Offline mkraska  
#1 Posted : 03 May 2014 13:47:12(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
In the SVN you find a plugin providing an editable image region (coded by Kay).

This is compatible with uni's image region. You can replace this in the image region plugin directory (for test only,

features:
- Double click launches the systems standard program for png- or svg-files. You may set that to your favorite editor, e.g. Windows Paint or inkscape.
- Context menu provides options to Import or Export images (no permanent link to the file name)
- Image is stored inside the sm-file, much like in the Picture Region
- Image is scaled to fit the region size while keeping aspect ratio (reset option to original size available in the context menu)
- Image file name (png or svg) can be specified in the image placeholder (invisible by default). Then
- if the file exists, region display is updated from file when recalculating
- if file does not exist, it is created based on current region contents
- Edit actions are performed using the specified file name
- Draw2D or Draw3D functions can directly be placed in the placeholder, thus you can hide the graphics commands completely by not displaying the input.
- Matrix data can be displayed as in uni's original version.

Edit process (you can only edit if the placeholder is empty)
- On double click, a temporary file is created if no file name is specified
- This file is sent to the image editor (based on system file type preferences)
- When you are done editing, just save the file and close the editor
- The modified file is read in
- Image is updated as soon as you leave the region.

Compared to Picture region it lacks the ability to be created by drag and drop or by pasting images from clipboard. Also, editing is not "in place" but in an external program.

I shall include this region in a portable SMath+Maxima version which is due for release soon.

Just to be clear: Best would be to edit in place with a decent tool set, possibly vector based. What we provide is a far approximation to this level of comfort.

Edited by user 16 May 2014 03:30:34(UTC)  | Reason: Not specified

File Attachment(s):
image.sm (90kb) downloaded 101 time(s).
mkraska attached the following image(s):
image1.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 03/05/2014(UTC),  on 04/05/2014(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline uni  
#2 Posted : 03 May 2014 15:10:06(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Quote:
It should be possible to merge Image region and ImageEdit region into an image region. Uni, could you do that? Would you otherwise mind us to mess around in your code?

You can merge both source code into an image region. I don't mind.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#3 Posted : 16 May 2014 03:20:57(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Uni, could you please try the merged region? Just replace your dll by this one:

https://smath.info/svn/p...gion/bin/Debug/Image.dll

There is one difference which I am aware of: If the file referenced in the placeholder does not exist, your version just didn't show anything, while Kay's version asks the user if he wants to create a new image. This may be a matter of taste, we would not insist on having it that way.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#4 Posted : 16 May 2014 13:59:28(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
I suggest to have the region border or the canvas border enabled by default (in the second case an option to enable/disable the border could be added in the context menu); this because if there's no placeholder, without image, you have a full-transparent region floating in the worksheet.


best regards,

Davide
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline uni  
#5 Posted : 16 May 2014 18:04:17(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: mkraska Go to Quoted Post
Uni, could you please try the merged region? Just replace your dll by this one:

https://smath.info/svn/p...gion/bin/Debug/Image.dll

There is one difference which I am aware of: If the file referenced in the placeholder does not exist, your version just didn't show anything, while Kay's version asks the user if he wants to create a new image. This may be a matter of taste, we would not insist on having it that way.

Feel free to extend the functionality of the plugin. There is a bit of my code. I would be glad if you add something. Also you can change the behavior of the plugin if necessary.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 16/05/2014(UTC)
Offline mkraska  
#6 Posted : 16 May 2014 21:03:14(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
I suggest to have the region border or the canvas border enabled by default (in the second case an option to enable/disable the border could be added in the context menu); this because if there's no placeholder, without image, you have a full-transparent region floating in the worksheet.

I'll ask Kay if he can activate the welcome message if there is no contents in the region in order to avoid the invisible region problem.
Also, for those who like the frames, perhaps a context menu option could be added.
One more option would be for setting png or svg as image format before creating it.

Btw, when working with images, the real fun comes when you want to make changes. Then you really feel the difference. Just double click, edit and save. No worries about where to store the image or to miss it when changing the file locations.

@uni: We perhaps shall upload the plugin separately to the gallery, in order not to interfere with your access rights. If you feel safe to do so, you can remove the original image region from the gallery (by just removing the folders?). Alternatively, you can just merge our changes with your plugin and upload it yourself. Or upload our svn version in place of yours, just to your taste.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 17/05/2014(UTC)
Offline mkraska  
#7 Posted : 17 May 2014 03:07:56(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
The attached file shows severe performance problems of the modified image region. SMath freezes upon scrolling. This does not happen with the original version by uni. I informed Kay about this. Therefore, it is still early for release in the online gallery.

You may need to switch on the math regions in order to produce the images. The page, however, is also part of the interactive book where the images should be included in the distribution (Contents> Graphics> Plotting with Maxima> Examples for drawdf)

Edited by user 17 May 2014 03:11:19(UTC)  | Reason: Not specified

File Attachment(s):
Examples maxima drawdf.sm (62kb) downloaded 59 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline mkraska  
#8 Posted : 23 September 2014 23:26:15(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
I switched the plots in the previous post to png, which results in much faster loading.
File Attachment(s):
Examples maxima drawdf.sm (685kb) downloaded 67 time(s).
mkraska attached the following image(s):
drawdf.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 24/09/2014(UTC),  on 24/09/2014(UTC)
Offline Alex M.  
#9 Posted : 26 September 2014 18:09:06(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Hello,

I have a peculiar issue not being able to import svg files into the image region (it sticks to the empty .png after the import). I can copy image region with .svg from interactive workbook and it behaves as intended. If, however, I replace (import) svg in the region by a different svg file it does not resize.

Also .sm file attached fails to plot to svg as it is intended.

What version of Smath should I use with this image region? Are there any other dependencies? I am using windows 7 x64 and portable smath with maxima 0.97 build 5346

Thanks!

Edited by user 26 September 2014 18:14:08(UTC)  | Reason: Not specified

File Attachment(s):
svg.sm (24kb) downloaded 52 time(s).
Offline mkraska  
#10 Posted : 26 September 2014 19:31:55(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: oxel007 Go to Quoted Post
Hello,

I have a peculiar issue not being able to import svg files into the image region (it sticks to the empty .png after the import). I can copy image region with .svg from interactive workbook and it behaves as intended. If, however, I replace (import) svg in the region by a different svg file it does not resize.

Also .sm file attached fails to plot to svg as it is intended.

What version of Smath should I use with this image region? Are there any other dependencies? I am using windows 7 x64 and portable smath with maxima 0.97 build 5346

Thanks!

It seems that you used an old sm file from the forum. Maxima and the image region until recently have undergone changes during the development. It is best to use the portable distribution with the graphics examples as included there ([?]> Graphics> Plotting with Maxima

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#11 Posted : 26 September 2014 19:42:56(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Thank you Martin,

However my goal is to import and work with .svg drawings - and this seems to be broken in my case. Unless I am doing something wrong (right click, import .svg does not work for me). Do you think it is a bug, or is it just my installation?

I found a work around though (that has some limitations):

0. specify working derictory
1. insert image region
3. name it "***.svg" - it will ask you if you want to create ***.svg in your working directory - OK

Note: after image is named "***.svg" it cannot be opened by double clicking

4. Delete image name (remove "***.svg)
5. Double click it to edit

Bug: image does not resize to fit the borders

Something does not seem to work as intended - likely tied to my Smath Studio install or hardware?

Offline mkraska  
#12 Posted : 26 September 2014 21:16:15(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: oxel007 Go to Quoted Post

Something does not seem to work as intended - likely tied to my Smath Studio install or hardware?

Please post the offending images and the sheet where you want to import them.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#13 Posted : 26 September 2014 23:57:08(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Here is the .sm workbook with all the steps I tried to correctly add .svg to image region. Svg files attached are referred to in the workbook.

Thanks!

Edited by user 26 September 2014 23:59:36(UTC)  | Reason: Not specified

File Attachment(s):
debug.sm (25kb) downloaded 54 time(s).
test.zip (4kb) downloaded 50 time(s).
thanks 1 user thanked Alex M. for this useful post.
on 27/09/2014(UTC)
Offline mkraska  
#14 Posted : 27 September 2014 11:27:54(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: oxel007 Go to Quoted Post
Here is the .sm workbook with all the steps I tried to correctly add .svg to image region. Svg files attached are referred to in the workbook.

I confirm that importing svg images does not work. This is a bug. I filed this in the BTS as SS-224.

I also confirm that the given svg images aren't resizable. This is due to the presence of the "width" and "height" tags in the svg image. If you remove these lines, then the image can be resized. Some svg producers have the option to create dynamic svg without these lines, among them is gnuplot with the terminal setting "svg dynamic".

I don't know if the svg renderer can be asked to ignore the setting. As a workaround, the lines could be commented out by the importer. I filed a corresponding request as SS-225

Thus, the current state for creating editable svg images is:
- link an existing (possibly blank) svg image by specifying it's name in the placeholder. Changes in the image file are reflected in the image region
- remove the name from the placeholder. Now the contents is saved in the .sm sheet and can be edited (double click)



Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Alex M.  
#15 Posted : 14 January 2016 19:14:37(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Is image region development still active? After working with it for more than a year I have tried numerous ways of using it as a primary sketching tool in SMath. I use it for creating engineering calculation books.

Overall its great. There are two points that it can be improved on.

1. Use of file format that supports layers. PaintNET's .pdn does that and also has a light-weight native editor (PaintNET). Any other file format would be great as well - the idea here to be able to scribble on top of base layer and than to delete and modify your scribbles as necessary.

2. Implement a variable that allows for image rotation - quite often the graph or another directly linked image does not fit into the printable area unless it is rotated. Often it is too cumbersome to rotate original file by hand (if it is created dynamically).

What do you guys think?
Offline Jean Giraud  
#16 Posted : 14 January 2016 20:57:00(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Alex,

You have missed something about CAS [Computer Algebra System]
NONE ... NONE is a graphic package, NONE will do what you ask for.
Mathematica, Maple, Matlab, MathcadPTC, Smath, Sage math, Scilab ...
Whatever you see from Joe Blo is math done. The main Mathematica book
is 3" thick, they have many more specialized application books ... etc.
"Drawing" is a graphic package. A graphic package is essentially a data
base system with very few analytic maths [Bézier to fillet and shapes ...]
Graphic packages range from freeware to !don't drop dead!
$5000/year per working station "Catia" [Boeing, Airbus, Bombardier].

"LibreCad", "FreeCad" are $0.00, unlimited use: both read/save AutoCad,
they are just limited in LISP.

If your project can be made in matrix form, Smath will output a 4D plot.
The matrix is splined, meshed at will, then goes the plot in 4 directions.

No idea about the max size of the matrix, slow on my machine.

"Scilab" is well geared in image processing [Satellite images, Police, weather ...]

Cheers, be good ... Jean
Offline Alex M.  
#17 Posted : 14 January 2016 21:07:32(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Alex,

You have missed something about CAS [Computer Algebra System]
NONE ... NONE is a graphic package, NONE will do what you ask for.


I do not think we understand each other here, Jean. What I ask for is already 95% implemented in SMath Studio by developers of image region plugin. Insert the region, double click, edit the .png in editor of your choice.

The extra that I ask is to support additional file format with layers (great for sketching over existing drawing). Additionally I was hoping you could rotate the image imbedded by image region by say, specifying the value in degrees.

I believe the only unreasonable portion of my request is that there might not be a developer who has time or willingness to make those changes. And I can most definitely understand that.

Image region is one of the 5 SMath plugins I found MOST useful over 2 years of me using SMath.
Offline mkraska  
#18 Posted : 15 January 2016 13:18:24(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Alex.M Go to Quoted Post
Is image region development still active? After working with it for more than a year I have tried numerous ways of using it as a primary sketching tool in SMath. I use it for creating engineering calculation books.

Overall its great. There are two points that it can be improved on.

1. Use of file format that supports layers. PaintNET's .pdn does that and also has a light-weight native editor (PaintNET). Any other file format would be great as well - the idea here to be able to scribble on top of base layer and than to delete and modify your scribbles as necessary.

2. Implement a variable that allows for image rotation - quite often the graph or another directly linked image does not fit into the printable area unless it is rotated. Often it is too cumbersome to rotate original file by hand (if it is created dynamically).

What do you guys think?


The capability of the image region to call an external editor for png was implemented in the course of the maxima plugin project at the University of Applied Sciences Brandenburg. Coding was done by Kay Graubmann, a student, who is no longer available. He was an exception in terms of commitment and skill. I did the spec, testing and doc but do not have any insight in the code and didn't write a single line of C#.

There is very little chance that I will learn C#, as I currently focus on CalculiX, a free and open source non-linear structural analysis software written in Fortran and C. See my examples page on Github. The link points to an example with a reference solution in smath cloud.

4 years ago I thought it was a good idea to support freshmen students with weak math skills by software tools like SMath Studio. I changed my mind in the meantime and now run my first mechanics course with complete ban of electronic assistance, just pencil and paper. I have seen too many students not even being able to apply the pythagorean theorem or dividing a fraction by a fraction.

I use the image region heavily to create sketches for exercises in engineering mechanics (I use paint to draw and use math regions for text labels).

The image region is already able to display svg images, however, you can't embed them in the document or call an external editor (IPE or Inkscape). This should not be too complicated to implement and might be a good start for someone with C# skills to take over fürther development. Everything is in the svn repository, so feel free to engage.

If there happens to be another smart student or sufficient money to pay an assistant, then I could resume development. If there was a chance to write plugins in Python, I might try this myself.

Best regards, Martin Kraska
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 15/01/2016(UTC)
Offline Jean Giraud  
#19 Posted : 15 January 2016 18:17:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Alex.M Go to Quoted Post
I do not think we understand each other here, Jean. What I ask for is already 95% implemented in SMath Studio by developers of image region plugin. Insert the region, double click, edit the .png in editor of your choice.

The extra that I ask is to support additional file format with layers (great for sketching over existing drawing). Additionally I was hoping you could rotate the image imbedded by image region by say, specifying the value in degrees.

I believe the only unreasonable portion of my request is that there might not be a developer who has time or willingness to make those changes. And I can most definitely understand that.

_______________________________

Yes Alex, we understand each other but not completely.

Zoomable drawings can only be *.svg. Other stuff is "Photo zoom" style.
Smath supporting *.svg is useless from the start whereas Smath is not a graphic package.
You could not add a line directly except by transiting via Paint for instance. The other crappy point is like this: If something has been created from a matrix, it will keep the matrix all over its uncorrupted life. EXAMPLE: my Mandebrot, Biomorph were created from Mathcad image matrix, exposed in the Mathcad picture operator, saved *.PNG ... they open in Smath as they were created. My logo [blue ellipse on black that you may have seen in some Smath work sheet], this logo is a Mathcad ordinary 2D then not a bitmap, rather a Microsoft Metafile. It was transited via WinGrab, saved *.PNG, it opens in Smath but crappy stuff.

I have the Mathcad program to rotate a photo or an *.bmp. That same photo/bmp, I can downsample by 2 [1/2 size] via a little program. I can zoom up to 2 via fft/ifft padding but Smath does have 3D fft/ifft. The available fft/ifft is the Fourier stuff I have attached recently [few more are still missing].

An RGB image, i.e: *.bmp is conventionally an augmented matrix of the 3 grayscale R, G, B. It's peanut to separate the R,G,B in three nested matrices then appliy Euler rotation on the matrix, but here you are stuck again because Smath does not have the capability of plotting matrices and does not create an image from matrix.

Two more points in context:
1. If you have a 2D Smath plot [2 vectors], easy to rotate clockwise/trig.
Mutiply the vector plot by the trig rotate function V*f(θ) not the other way around,
it follows universal algebraic rule element wise. Same thing with 3D Euler rotation

2. I could but can't demo a little 'svg'. That is done in Mathcad, it needs to implement
De Casteljau 3 lines algorithm. I can rotate it as well. Not possible in Smath because Smath is not a scalar CAS except for the Smath quick plot of an entire function.

The wish list CAS + CAD lasted 10 years in the Mathsoft Collaboratory. As it looks, PTC have some convenient way of plugging some of their ProEngineer stuff in their Mathcad. It may be the route to your wish list. Be careful, downloading PTC Mathcad it is the crookery of the century. EXPLAIN: when you download it comes with "Artemis", Artemis is not a virus, just a fishing hooke. Artemis is a little code that can chain several web links. The purpose is to connect the victim to a another kind of web spy netwoork. The PTC Artemis is a triple link: the frist one is the Mathcad stuff, the 2nd is a web link to Costa Rica server . From this server is fishes for any and all information coming in/out of your box, hours used, clients address, ID card info, bank ... may be not the brand of the toilet paper. The 3rd link is the "TimeStamp" 30 days free trial. Then you are f...d with Artemis that apparently can't be removed from PC. Would you want PTC contacting your client from the back door. Your client stuff is surely private until his busness is well established.

Jean

Jean
Offline Alex M.  
#20 Posted : 28 January 2016 18:10:21(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: mkraska Go to Quoted Post

The image region is already able to display svg images, however, you can't embed them in the document or call an external editor (IPE or Inkscape). This should not be too complicated to implement and might be a good start for someone with C# skills to take over fürther development. Everything is in the svn repository, so feel free to engage.

Best regards, Martin Kraska


Hi Martin,

I was tinkering with the region to add the svg support (blank document that opens on double click).

Do you think a dialog box that lets you choose png or svg on region initialization is appropriate? Or do you prefer a different method for choosing between two?

SMath community, feel free to engage in discussion!

thanks 1 user thanked Alex M. for this useful post.
on 28/01/2016(UTC)
Users browsing this topic
Guest
Similar Topics
Editable Image Region - Plugin Update (Extensions)
by Alex M. 14/02/2016 09:46:23(UTC)
6 Pages123>»
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.