dimarts, 5 de maig del 2026

Geometric Fullerenes: Pentagon Web Rendering

🚀 Geometric Fullerenes: Pentagon Web Rendering

In this post, we explore the geometry of Fullerenes using JavaScript. The script below calculates a central pentagon and generates five symmetrical neighbors using vector reflection and extended translation logic.

đź’ˇ Instructions: Click the "Copy Script" button below, then open your browser's Developer Tools (F12), go to the Console tab, paste the code, and press Enter.

fullerene_generator.js
(function renderPentagonWeb() {
  const centerX = 300, centerY = 300, radius = 60;
  const pentagonSystem = [];
  
  // Logic for Central Pentagon, Reflection, 
  // and Extended Translation...
  // [Click Copy to see full script]
})();

Generated with Gemini AI Tools.

dijous, 4 de desembre del 2025

Autocad no dibuixa automĂ ticament en coordenades ABSOLUTES sinĂł relatives

 RESOLT!

  • Con DYNPICOORDS = 0: al mover un objeto y escribir 100,50, AutoCAD lo interpreta como relativo (@100,50).

  • Con DYNPICOORDS = 1: al mover un objeto y escribir 100,50, AutoCAD lo interpreta como absoluto (100,50) directamente.

  • dilluns, 8 de setembre del 2025

    VLISP - from wired box to cylindric beams (by Gemini 2.5 Pro)

     ;; -----------------------------------------------------------------------------
    ;; Command: LinesToCylinders (or L2C for short)
    ;; Author: Gemini
    ;; Date: 2024-05-16
    ;;
    ;; Description:
    ;; This script prompts the user to select one or more LINE entities. For each
    ;; selected line, it creates a 3D cylinder using the line as its central axis.
    ;; The radius of the created cylinders is fixed at 5 units.
    ;;
    ;; How to Use:
    ;; 1. Load this file into AutoCAD using the APPLOAD command.
    ;; 2. Type "LINES2CYL" or "L2C" in the command line and press Enter.
    ;; 3. Select the lines you want to convert into cylinders.
    ;; 4. Press Enter to confirm your selection. The cylinders will be created.
    ;; -----------------------------------------------------------------------------

    (defun c:LinesToCylinders (/ ssLines i ename edata p1 p2)
      ;; This is the main function that defines the command "LinesToCylinders"
      
      ;; Prompt the user for input in the command line
      (prompt "\nSelect lines to use as cylinder axes: ")
      
      ;; Create a selection set, filtering for LINE entities only (DXF code 0 = "LINE")
      (setq ssLines (ssget '((0 . "LINE"))))
      
      ;; Check if the selection set is not nil (i.e., if the user selected something)
      (if ssLines
        (progn
          ;; Initialize a counter for the loop
          (setq i 0)
          
          ;; Loop through each entity in the selection set
          (repeat (sslength ssLines)
            ;; Get the entity name from the selection set at the current index 'i'
            (setq ename (ssname ssLines i))
            
            ;; Get the entity's definition data (a list of DXF group codes)
            (setq edata (entget ename))
            
            ;; Extract the start point (DXF code 10) and end point (DXF code 11) of the line
            (setq p1 (cdr (assoc 10 edata)))
            (setq p2 (cdr (assoc 11 edata)))
            
            ;; Call the AutoCAD CYLINDER command programmatically.
            ;; The dot "." ensures the standard command is used.
            ;; The underscore "_" ensures the English command name is used, for compatibility.
            ;;
            ;; Command sequence breakdown:
            ;; "._CYLINDER" : Starts the command.
            ;; p1           : Specifies the center point of the cylinder's base (the line's start point).
            ;; 5            : Sets the radius to 5.
            ;; "_A"         : Chooses the "Axis Endpoint" option.
            ;; p2           : Specifies the other end of the axis (the line's end point).
            (command "._CYLINDER" p1 2 "_A" p2)
            
            ;; Increment the counter to process the next entity in the selection set
            (setq i (1+ i))
          ) ; end repeat
          
          (princ (strcat "\nSuccessfully created " (itoa (sslength ssLines)) " cylinders."))
        ) ; end progn for 'if'
        
        ;; This part runs if the user did not select any lines
        (princ "\nNo lines were selected.")
        
      ) ; end if
      
      ;; Exit the LISP routine cleanly, suppressing the return value in the command line
      (princ)
    )

    ;; Define a shorter alias for the command for easier access.
    ;; Now you can type either "LinesToCylinders" or "L2C".
    (defun c:L2C () (c:LinesToCylinders))

    (princ "\nLISP file loaded. Type LINES2CYL or L2C to run.")
    (princ)

    the code has been prompt in Gemini


    Conversation with Gemini

    in autocad vlisp code. user select a bunch of lines. the code uses the lines as axle to create cylinders radius 5

    Show thinking

    Of course. I'll create a VLISP file that you can load into AutoCAD. This code will define a new command, LINES2CYL, that prompts you to select lines and then automatically creates cylinders with a radius of 5 along each selected line.

    Here is the VLISP code file.

    Lines to Cylinders

    8 Sept, 17:36

    Try again without Canvas

    I've created the LISP file for you. To use it, simply load lines_to_cylinders.lsp into your AutoCAD session using the APPLOAD command. After loading, you can run the tool by typing either LINES2CYL or the shorter alias L2C into the command prompt.

     



    dijous, 27 de març del 2025

    Ollama on windows - LLM on local machine

     https://youtu.be/C7rFk-GbdCg?si=_U1Q1FhrgDkSIYHF

    https://medium.com/@Tanzim/how-to-run-ollama-in-windows-via-wsl-8ace765cee12


    and saving models to another location

    https://youtu.be/uj1VnDPR9xo?si=YP0PokJwynLyYFmY

    the path in wsl must be like this (... must be replaced by the user name)

    /mnt/c/Users/.../AppData/Local/Programs/Ollama/ollama.exe run gemma3:latest

    when in windows is 

    C:\Users\...\AppData\Local\Programs\Ollama

    dissabte, 15 de març del 2025

    EXCEL - Scatter Plot - how to label points as data from col A:A (Alt+F11) - Insert Module

     Sub LabelScatterPlot()
        Dim chartObj As ChartObject
        Dim srs As Series
        Dim i As Integer
        
        ' Change "Sheet1" to your sheet name
        Set chartObj = Sheets("Sheet4").ChartObjects(1) ' First chart on the sheet
        Set srs = chartObj.Chart.SeriesCollection(1) ' First data series

        For i = 1 To srs.Points.Count
            srs.Points(i).ApplyDataLabels
            srs.Points(i).DataLabel.Text = Sheets("Sheet4").Range("A" & (i + 1)).Value
        Next i
    End Sub