42,871 reputation
566175
bio website
location
age
visits member for 2 years, 7 months
seen 1 hour ago

Aug
20
comment Gradient Filter Function
You can view the definition of GradientFilter and the functions it depends on using Spelunk
Aug
19
comment Problem with hole filling using filledCurveToPolygons3D in MMA 10
The InPolygonQ function has moved in version 10 to Graphics`PolygonUtils`InPolygonQ. With that change it should work properly.
Aug
18
comment Simple string pattern crashes kernel
No problem with version 10 on Windows 7
Aug
17
comment How to modify the elements of a list in a loop?
I think the OP wants to apply each transformation in turn to each point, i.e. points.Transpose[t2.rx.t1]. It's hard to tell though, when the only thing we have to go on is some code which does something else entirely.
Aug
15
comment Determining the total illumination of a polygon
The rendering happens when the front end displays the graphics, so I don't think there is any way to obtain the illumination from the kernel. You could Rasterize the graphics and read a pixel value from the result but this will get tricky if there is more than one polygon.
Aug
15
comment Convert spectral distribution to RGB color
@MichaelE2, I enjoy a bit of spelunking, but it does frustrate me sometimes that gems like CIE color matching functions are built in but not made easily available.
Aug
15
comment Convert spectral distribution to RGB color
Nice! I wasn't too far wrong then, just got the normalisation wrong (as I suspected). It seems that the built-in "BlackBodySpectrum" is not quite right.
Aug
14
comment How to make a stereogram in Mathematica? (2)
In fact my original code was broken (though I'm not sure exactly what was wrong). The new version is similar in spirit to what you have here - copying pixels in a loop rather than attempting to do it all in one go with Part.
Aug
14
comment How to make a stereogram in Mathematica? (2)
The shift needs to be a relative shift between a part of the image and its corresponding part in the tile to the left. So each vertical strip forms the "baseline" image to which shifts are applied for the next strip. That's why the Accumulate was there. In your code here you are shifting each pixel relative to the background, so for every "hill" in the 3D profile you will get a matching "hole" one tile to the right.
Aug
14
comment How to make a stereogram in Mathematica?
Regarding the artifacts, I think I may have the algorithm slightly wrong, though I can't see where. When I get a chance I will try to fix it.
Aug
13
comment How to make a stereogram in Mathematica?
@Ajasja, the threading error is because Rasterize gives an RGB image and the depth map needs to be grayscale. You could use ColorConvert, or just create the values directly in a Table (I extract the ImageData in the next line anyway).
Aug
13
comment How to make a stereogram in Mathematica?
@user16069, it should be fairly easy to create a depth map from a 3D model. You just need to shade each vertex according to its distance from the viewpoint. If you need help with it I would suggest asking a new question.
Aug
13
comment How to plot data points in the form X, Y, E(X, Y) where X and Y coordinates are not ordered?
In version 10 you could also use Plot3D[f[x, y], {x, y} ∈ Rectangle @@ Transpose @ f["Domain"]]
Aug
12
comment Incompatible Changes since Mathematica Version 7?
@eldo, I think the Inset thing is a bug rather than a deliberate change, so it doesn't belong in this list in my opinion.
Aug
12
comment Optimization in Mathematica
Perhaps you could provide a smaller representative data set, or code to generate one. Without more specifics about your Mathematica code nobody can answer why it is slow.
Aug
11
comment Ragged Diamonds
@eldo, i is just the iterator variable. In the outer loop it acquires values from diamondcounts[n] and then the inner loop runs i times.
Aug
10
comment Ragged Diamonds
+1 Clever use of ArrayPad
Aug
10
comment Plotting a transformed region only works with integer inputs
Confirmed on Windows 7.
Aug
8
comment Combining images with CUDA
The question is much clearer now, thank you. Note that your InsertImage is not actually an image but a Graphics expression. Instead of Inset you could use Translate which is quite efficient at positioning multiple copies of a single object, e.g. Graphics[Translate[InsertImage[[1]], 20 PosList], Background -> Black]
Aug
7
comment Apply an image as a texture to text
@LiamWilliam, to avoid changing the aspect ratio of the texture you will need to use AspectRatio -> Automatic and TextureCoordinateScaling -> False along with a texture coordinate function like (0.08 {#1, ar #2} &) where ar is the aspect ratio of the texture image ar = Divide@@ImageDimensions[image] and the numerical factor is adjusted to give the desired number of tilings.